-
-
Save dljoseph/7fdd98d3778b010e10b8 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) 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