Hi All,
I was just wondering if anyone has managed to implement a GridField that allows you to edit records that use the hierarchy extension?
I think I am almost there, but everytime I add a new record (or edit an existing item) and set the ParentID, the CMS redirects me back to the parent GridField and all the admin JS breaks (requiring a refresh).
The basic call in my getCMSFields is as follows:
$fields->addFieldToTab(
'Root.Children',
GridField::create(
"Children",
"",
Category::get()->filter("ParentID", $this->ID),
new GridFieldConfig_RelationEditor()
)
);
I have tried various different config classes (and have even written my own), to no effect. I suspect the issue might be that once I change the parent ID, the item no longer exists in the current list, and that is causing this behaviour. But i am not 100% if this is the case and was wondering if anyone has overcome this hurdle?
Many thanks,
Mo