Created
May 12, 2015 15:16
-
-
Save kinglozzer/be282971b161b062f9f9 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) { | |
// You can use $form in here | |
}); | |
return $form; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This morning I get a different idea. Since I only wanted to add extra class on form, I actually get the Tab that I'm on and add class there. It work like a charm, so no need to wrap fields or doing anything. Thank you for your help btw.