简体   繁体   中英

How to create list field type in sonata admin

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM