简体   繁体   中英

Editable field action in sonata list view

I have a list view in sonata admin. I want to edit integer field directly in list view. New data for this field must change other fields in my entity. How can I add action function to this editable field in which I may do some actions with other fields depending on entering integer value?

Please check documentation: https://sonata-project.org/bundles/admin/master/doc/cookbook/recipe_custom_action.html

Basically, what you need is a custom route and and a controller, same way as you handle any page/request. Than you can do any logic you like making requests to this routes (even with AJAX). Documentation will help you the best with this.

And to add an "editable field" or a link or a button in List view, just create custom template piece: https://sonata-project.org/bundles/admin/master/doc/reference/templates.html

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