Hi there,
first off all, I'm using SilverStripe 3.2 RC1.
I need to modify the shown fields of a gridfield item if you click on it. To accomplish this I'm modifying the 'GridFieldDetailForm' fields like that
$bundleGridForm = $bundleGridConfig->getComponentByType('GridFieldDetailForm');
$detailFormFields = FieldList::create(
TabSet::create(
'Root',
Tab::create(
'Haupt-Inhalt',
CheckboxSetField::create(
'ManyMany[AvailableVariations]',
'Verfügbare Variationen',
$HELP-NEEDED-HERE->VariationItems()->map()->toArray()
)
)
)
);
$bundleGridForm->setFields($detailFormFields);
As you can see, I'd like to only display an CheckboxSetField and as source
$HELP-NEEDED-HERE->VariationItems()->map()->toArray()
I'd like to use a realation (VariationItems) of the currently selected / clicked item.
The Problem is I don't know how to get this Relation, because $this is of course referencing to the class, where my gridfield is on and not to the clicked item.
Perhapse the handleItem() function is what I need because it returns the GridFieldDetailForm_ItemRequest class where I can than call the getRecord() function. But all of this presupposes that I get the request form the gridfield to use the handleItem() function and I absolutely can't figure out how to get this record.
For any help I would be very grateful.
Best Regards