4

In the parent entity I can do something like that:

protected function configureFormFields(FormMapper $formMapper)
{

    $formMapper->add('units', 'sonata_type_collection', [
        'required' => true,
        'by_reference' => false,
        'label' => 'Units',
        'type_options' => [
            'delete' => true,
        ],
        'btn_add' => 'Add unit',
    ], [
        'edit' => 'inline',
        'inline' => 'table',
        'sortable' => 'position',
        'multiple' => true,
    ]);
}

This will display a delete checkbox. What is a proper way of having a simple "Delete" button next to every unit allowing for deleting it from the list? Is it possible to have something like this with minimal configuration?

Łukasz Zaroda
  • 869
  • 2
  • 19
  • 55

1 Answers1

0

I guess with minimal config is not possible. You should override a template or make your own

Athos
  • 181
  • 6