Question

I'm using Symfony 2.3 and newest SonataAdminBundle. It's possible to create editable fields in list view with SonataAdminBundle? What is the best practice?

Was it helpful?

Solution

Try this:

$listMapper
            ->addIdentifier('title')
            ->addIdentifier('artist')
            ->add('createDate')
            ->add('changeDate')
            ->add('missing', null, array('editable' => true))
            ->add('_action', 'actions', array(
                'actions' => array(
                    'view' => array(),
                    'edit' => array(),
                    'delete' => array()
                )
            ))
        ;

Notice the array('editable' => true). For booleans this works, I'm not sure for other fields.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top