1
votes

I'm using sonata admin and there is an option 'editable' => true for edit directly inline datas on the list view.

If my field is a text, it's ok, i can click, edit the text and save directly on the table.

But i don't want an input type="text" when i click on the field, but a list, i'm trying something like :

->add('etat', null, array('editable' => true), 'choice', array(
                'choices'   => array(
                    'Brut'   => 'Brut',
                    'NRP' => 'NRP',
                )
            ))

But no effetc.. is this possible ?

3

3 Answers

1
votes

Since Sonata Admin Bundle 2.2 choice accepts the "editable" parameter in the list view. You use it like that:

$listMapper->add('etat', 'choice', [
               'choices'=>['Brut'=>'Brut', 'NRP' => 'NRP',],
               'editable'=>true,
               ]);

Doc: https://sonata-project.org/bundles/admin/2-2/doc/reference/field_types.html

0
votes

Well it's not possible at the moment and won't be possible as I can guess in the near future. Your own realization should be written.