Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Extend delete button from a gridfield


Go to End


3 Posts   1171 Views

Avatar
StefGuev

Community Member, 6 Posts

16 June 2016 at 1:22am

Hi everyone, I dont know if it's possible. I want to add or extend the Delete button into a GridField.

In example, I have a ModelAdmin showing DataObjects Advertising, when I Delete a records from Advertising, I want to delete any relations with that record in another Dataobject using it.

Possible? Thank in advance and sorry for my pitty english

Avatar
Devlin

Community Member, 344 Posts

16 June 2016 at 8:48pm

The simplest way would be to use a onBeforeDelete() or onAfterDelete() function in your DataObject Advertising.

https://docs.silverstripe.org/en/3.3/developer_guides/model/extending_dataobjects/

Avatar
StefGuev

Community Member, 6 Posts

17 June 2016 at 12:46am

Edited: 17/06/2016 2:30am

I'll give it a try and it's work many thanks!