Reputation: 825
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
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