Permalink
Browse files

MINOR Removed GridField->getDefaultConfig() in favour of new GridFiel…

…dConfig_Base class (and adjusted its components to remove the "edit" component, and add the "filter" component by default, to match the original getDefaultDefaultConfig())
  • Loading branch information...
chillu committed Jan 30, 2012
1 parent 5fe86be commit a135b7c01df8034e414e8dc29cebb98efaf110d1
Showing with 2 additions and 16 deletions.
  1. +1 −15 forms/gridfield/GridField.php
  2. +1 −1 forms/gridfield/GridFieldConfig.php
@@ -87,7 +87,7 @@ public function __construct($name, $title = null, SS_List $dataList = null, Grid
}
if(!$config) {
- $this->config = $this->getDefaultConfig();
+ $this->config = GridFieldConfig_Base::create();
} else {
$this->config = $config;
}
@@ -142,20 +142,6 @@ protected function setComponents(GridFieldConfig $config) {
return $this;
}
- /**
- * Get a default configuration for this GridField
- *
- * @return GridFieldConfig
- */
- protected function getDefaultConfig() {
- $config = GridFieldConfig::create();
- $config->addComponent(new GridFieldSortableHeader());
- $config->addComponent(new GridFieldFilter());
- $config->addComponent(new GridFieldDefaultColumns());
- $config->addComponent(new GridFieldPaginator());
- return $config;
- }
-
/**
* Require the default css styling
*/
@@ -85,8 +85,8 @@ public static function create($itemsPerPage=25){
*/
public function __construct($itemsPerPage=25) {
$this->addComponent(new GridFieldSortableHeader());
+ $this->addComponent(new GridFieldFilter());
$this->addComponent(new GridFieldDefaultColumns());
- $this->addComponent(new GridFieldAction_Edit());
$this->addComponent(new GridFieldPaginator($itemsPerPage));
}
}

0 comments on commit a135b7c

Please sign in to comment.