简体   繁体   中英

Sonata bundle editable date field

Sonat admin bundle allow to edit only text fields and boolean, i would like to know if there a way to override sonata make it edit datetime/date fields.

Thank you in advance!

At this time , they only support scalar types :

Theses types accept an editable parameter to edit the value from within the list action. This is currently limited to scalar types (text, integer, url...).

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

I guess to have to digg more into the documentation to get it working. ( See how scalar types are dealt with and try to write similar logic )

Not sure in which version they added this (can't find it in the change log), but in admin bundle 3.8.0 adding 'editable' => true' to a date field in a list makes it editable alright. The value becomes underlined with a dashed line and clicking it opens a jQuery date selector.

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