Silverstripe 3.1 - many_many relation - unlink and delete entries

丶灬走出姿态 提交于 2020-01-06 15:02:12

问题


Normally there's only a unlink function for the entries in a many_many relation grid field. But that's messy.

How can I also add an delete option?


回答1:


you can use:

$config->addComponent(new GridFieldDeleteAction(false));

which will add a delete button. The false argument specify that it is a delete button not unlink. $config is your GridFieldConfig instance.



来源:https://stackoverflow.com/questions/19524951/silverstripe-3-1-many-many-relation-unlink-and-delete-entries

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!