invictus
invictus

Reputation: 825

Silverstripe 3.1 - many_many relation - unlink and delete entries

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?

Upvotes: 0

Views: 1279

Answers (1)

colymba
colymba

Reputation: 2644

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.

Upvotes: 3

Related Questions