mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
32 lines
926 B
PHP
32 lines
926 B
PHP
|
<?php
|
||
|
|
||
|
namespace SilverStripe\Forms\GridField;
|
||
|
|
||
|
/**
|
||
|
* A simple readonly, paginated view of records, with sortable and searchable
|
||
|
* headers.
|
||
|
*/
|
||
|
class GridFieldConfig_Base extends GridFieldConfig
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @param int $itemsPerPage - How many items per page should show up
|
||
|
*/
|
||
|
public function __construct($itemsPerPage = null)
|
||
|
{
|
||
|
parent::__construct();
|
||
|
$this->addComponent(new GridFieldToolbarHeader());
|
||
|
$this->addComponent($sort = new GridFieldSortableHeader());
|
||
|
$this->addComponent($filter = new GridFieldFilterHeader());
|
||
|
$this->addComponent(new GridFieldDataColumns());
|
||
|
$this->addComponent(new GridFieldPageCount('toolbar-header-right'));
|
||
|
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
||
|
|
||
|
$sort->setThrowExceptionOnBadDataType(false);
|
||
|
$filter->setThrowExceptionOnBadDataType(false);
|
||
|
$pagination->setThrowExceptionOnBadDataType(false);
|
||
|
|
||
|
$this->extend('updateConfig');
|
||
|
}
|
||
|
}
|