MINOR Removed GridField->getDefaultConfig() in favour of new GridFieldConfig_Base class (and adjusted its components to remove the "edit" component, and add the "filter" component by default, to match the original getDefaultDefaultConfig())

This commit is contained in:
Ingo Schommer 2012-01-30 15:51:07 +01:00
parent 5fe86be311
commit a135b7c01d
2 changed files with 2 additions and 16 deletions

View File

@ -87,7 +87,7 @@ class GridField extends FormField {
}
if(!$config) {
$this->config = $this->getDefaultConfig();
$this->config = GridFieldConfig_Base::create();
} else {
$this->config = $config;
}
@ -142,20 +142,6 @@ class GridField extends FormField {
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
*/

View File

@ -85,8 +85,8 @@ class GridFieldConfig_Base extends GridFieldConfig {
*/
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));
}
}