Created
July 15, 2015 13:33
-
-
Save lozcalver/8c14cfd1108ad27380f7 to your computer and use it in GitHub Desktop.
This file contains 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) use ($self) { | |
$form->Actions()->removeByName('action_doDelete'); | |
}); | |
return $form; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment