Adds two new buttons to Silverstripes Gridfield Detailform, Save and Close, and Save and Add Another
Robert Clarkson (rob@robertclarkson.net)
SilverStripe 3.1+
Easy to add to any Gridfield. On the GridFieldConfig, get the GridfieldDetailForm, then set the ItemRequestClass to this new extension.
//assume you've already got a config, something like this
$gridfieldconfig = GridFieldConfig_RelationEditor::create();
//here's the magic
$detailForm = $gridfieldconfig->getComponentByType('GridFieldDetailForm');
$detailForm->setItemRequestClass('GridfieldDetailFormExtraButtons');
//Then you're adding the config to your gridfield
$myGridfield = new GridField('MyClass', 'My Class', $this->Relation(), $gridfieldconfig);