Permalink
Browse files

Added ModelAdmin customization docs

  • Loading branch information...
1 parent b6017a7 commit 8c2e3230c885802a7d0d02e14e66c0ba5eae9f6e @chillu chillu committed Nov 15, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 docs/en/reference/modeladmin.md
@@ -130,6 +130,19 @@ For example, we might want to have a checkbox which limits search results to exp
}
}
+To alter how the results are displayed (via `[api:GridField]`), you can also overload the `getEditForm()` method. For example, to add a new component.
+
+ :::php
+ class MyAdmin extends ModelAdmin {
+ // ...
+ public function getEditForm($id = null, $fields = null) {
+ $form = parent::getEditForm($id, $fields);
+ $gridField = $form->Fields()->fieldByName($this->sanitiseClassName($this->modelClass));
+ $gridField->getConfig()->addComponent(new GridFieldFilterHeader());
+ return $form;
+ }
+ }
+
## Managing Relationships
Has-one relationships are simply implemented as a `[api:DropdownField]` by default.

0 comments on commit 8c2e323

Please sign in to comment.