mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
5fe86be311
commit
a135b7c01d
@ -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
|
||||
*/
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user