View more context

 

jakx

I have a button I don't want that works and a menu item I want that doesn't work

null

take those two examples in the docs and squash them together. I noticed the latter one is a GridFieldCustomAction too, with an extra interface added

null

won't have time to test out until later

🙏 (1)
null

yeah, that. Take all the methods from the first example and put them in the second, after that line

null

that's what I'm going to try when I get the chance 😛

jakx

@null I think I've cracked it. getExtraData() behaves well when it returns the attributes of a form action. GridFieldDeleteAction::getExtraData() is a good example of this.

If you follow the docs, the action menu item created will be useless. But if GridFieldCustomAction::getExtraData() returns the attributes of a GridField_FormAction, it behaves as expected

null

You can become a legend in the framework git history

😁 (1)
jakx

@null https://github.com/silverstripe/silverstripe-framework/pull/9169

Show 1 attachment(s)
GitHub  
Update 04_Create_a_GridField_ActionProvider.md by jakxnz · Pull Request #9169 · silverstripe/silverstripe-framework

Updated the How to add a custom action to a GridField row with more details surrounding creating an action in the GridField action menu dropdown, as well as the corresponding boilerplate (with code...

Hide attachment content
(2)