Created
November 4, 2016 16:29
-
-
Save lozcalver/d67de55b86b9cbd7bc39a669772cf1a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SomeModelAdmin extends ModelAdmin { | |
private static $managed_models = array( | |
"MyDataObject" | |
); | |
public function getEditForm($id = null, $fields = null) { | |
$form = parent::getEditForm($id, $fields); | |
$gridField = $form->Fields()->dataFieldByName('MyDataObject'); | |
$detailForm = $gridField->getConfig()->getComponentByType('GridFieldDetailForm'); | |
$detailForm->setItemEditFormCallback(function($form) { | |
$form->Actions()->removeByName('action_doSave'); | |
}); | |
return $form; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment