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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

onAfterwrite on GridField?


Go to End


3 Posts   747 Views

Avatar
esakrielaart

Community Member, 59 Posts

14 July 2012 at 8:33am

Hi all,

digging into GridField, I'm wondering if there is a way to perform actions like page-reload when a relation is written using GridField and the GridFieldConfig_RelationEditor (so handleAction is called with action 'addto' for instance).

I know onAfterWrite() is triggered upon saving a form generated with getCMSFields(), but this GridField is a form generated within getCMSFields and may save relations before clicking the 'general' save button.

Friendly regards,
Maurice

Avatar
Reflektera

49 Posts

12 September 2012 at 12:02am

Did you solve this? Pls say you did...

Avatar
esakrielaart

Community Member, 59 Posts

12 September 2012 at 7:44pm

Hi,

although I did not yet solve this, you might try things using jQuery/entwinte as I think you need some technique of those to be able to 'dynamically' add or remove classes from the gridfield. I didn't have the need for it anymore at this point, but if I work it out in the future, I sure let you know.

Friendly regards,
Maurice