Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Don't duplicate pagination defaults from GridFieldPaginator in …

…GridFieldConfig
  • Loading branch information...
commit ea31e1798a542e07c6761a9e1bd009cc3d10361e 1 parent 6798d40
@chillu chillu authored
View
16 forms/gridfield/GridFieldConfig.php
@@ -101,7 +101,7 @@ class GridFieldConfig_Base extends GridFieldConfig {
* @param int $itemsPerPage - How many items per page should show up per page
* @return GridFieldConfig_Base
*/
- public static function create($itemsPerPage=15){
+ public static function create($itemsPerPage=null){
return new GridFieldConfig_Base($itemsPerPage);
}
@@ -109,7 +109,7 @@ public static function create($itemsPerPage=15){
*
* @param int $itemsPerPage - How many items per page should show up
*/
- public function __construct($itemsPerPage=15) {
+ public function __construct($itemsPerPage=null) {
$this->addComponent(new GridFieldTitle());
$this->addComponent(new GridFieldSortableHeader());
$this->addComponent(new GridFieldFilter());
@@ -128,7 +128,7 @@ class GridFieldConfig_RecordEditor extends GridFieldConfig {
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RecordEditor
*/
- public static function create($itemsPerPage=15){
+ public static function create($itemsPerPage=null){
return new GridFieldConfig_RecordEditor($itemsPerPage);
}
@@ -136,7 +136,8 @@ public static function create($itemsPerPage=15){
*
* @param int $itemsPerPage - How many items per page should show up
*/
- public function __construct($itemsPerPage=15) {
+ public function __construct($itemsPerPage=null) {
+ $this->addComponent(new GridFieldTitle());
$this->addComponent(new GridFieldSortableHeader());
$this->addComponent(new GridFieldFilter());
$this->addComponent(new GridFieldDefaultColumns());
@@ -169,15 +170,16 @@ class GridFieldConfig_RelationEditor extends GridFieldConfig {
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RelationEditor
*/
- public static function create($itemsPerPage=15){
- return new GridFieldConfig_RelationEditor($itemsPerPage=15);
+ public static function create($itemsPerPage=null){
+ return new GridFieldConfig_RelationEditor($itemsPerPage);
}
/**
*
* @param int $itemsPerPage - How many items per page should show up
*/
- public function __construct($itemsPerPage=15) {
+ public function __construct($itemsPerPage=null) {
+ $this->addComponent(new GridFieldTitle());
$this->addComponent(new GridFieldRelationAdd());
$this->addComponent(new GridFieldSortableHeader());
$this->addComponent(new GridFieldFilter());
View
4 forms/gridfield/GridFieldPaginator.php
@@ -31,8 +31,8 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
*
* @param int $itemsPerPage - How many items should be displayed per page
*/
- public function __construct($itemsPerPage=15) {
- $this->itemsPerPage = $itemsPerPage;
+ public function __construct($itemsPerPage=null) {
+ if($itemsPerPage) $this->itemsPerPage = $itemsPerPage;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.