Skip to content

Instantly share code, notes, and snippets.

@hailwood
Last active September 9, 2015 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hailwood/92f78ae37d932c16b57d to your computer and use it in GitHub Desktop.
Save hailwood/92f78ae37d932c16b57d to your computer and use it in GitHub Desktop.
<?php
class MyModelAdmin extends ModelAdmin {
//..
public function getEditForm($id = null, $fields = null) {
$form = parent::getEditForm($id, $fields);
$gridFieldName = $this->sanitiseClassName($this->modelClass);
/** @var GridField $gridField */
$gridField = $form->Fields()->fieldByName($gridFieldName);
$gridField->getConfig()
->addComponent(new GridFieldFilterHeader())
->addComponent(new GridFieldSortableRows('SortOrder'));
//here I want to do some extra actions after the GridFieldSortableRows has applied
//it's modifications to the gridfield!
return $form;
}
//..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment