Skip to content

Commit

Permalink
MINOR Removed GridField->getDefaultConfig() in favour of new GridFiel…
Browse files Browse the repository at this point in the history
…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 a135b7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
16 changes: 1 addition & 15 deletions forms/gridfield/GridField.php
Expand Up @@ -87,7 +87,7 @@ public function __construct($name, $title = null, SS_List $dataList = null, Grid
} }


if(!$config) { if(!$config) {
$this->config = $this->getDefaultConfig(); $this->config = GridFieldConfig_Base::create();
} else { } else {
$this->config = $config; $this->config = $config;
} }
Expand Down Expand Up @@ -142,20 +142,6 @@ protected function setComponents(GridFieldConfig $config) {
return $this; 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 * Require the default css styling
*/ */
Expand Down
2 changes: 1 addition & 1 deletion forms/gridfield/GridFieldConfig.php
Expand Up @@ -85,8 +85,8 @@ public static function create($itemsPerPage=25){
*/ */
public function __construct($itemsPerPage=25) { public function __construct($itemsPerPage=25) {
$this->addComponent(new GridFieldSortableHeader()); $this->addComponent(new GridFieldSortableHeader());
$this->addComponent(new GridFieldFilter());
$this->addComponent(new GridFieldDefaultColumns()); $this->addComponent(new GridFieldDefaultColumns());
$this->addComponent(new GridFieldAction_Edit());
$this->addComponent(new GridFieldPaginator($itemsPerPage)); $this->addComponent(new GridFieldPaginator($itemsPerPage));
} }
} }
Expand Down

0 comments on commit a135b7c

Please sign in to comment.