38 lines
1.4 KiB
PHP
38 lines
1.4 KiB
PHP
<?php
|
|
namespace SilverStripe\Forms\GridField;
|
|
|
|
/**
|
|
* Allows editing of records contained within the GridField, instead of only allowing the ability to view records in
|
|
* the GridField.
|
|
*/
|
|
class GridFieldConfig_RecordEditor extends GridFieldConfig
|
|
{
|
|
/**
|
|
*
|
|
* @param int $itemsPerPage - How many items per page should show up
|
|
*/
|
|
public function __construct($itemsPerPage = null)
|
|
{
|
|
parent::__construct();
|
|
|
|
$this->addComponent(new GridFieldButtonRow('before'));
|
|
$this->addComponent(new GridFieldAddNewButton('buttons-before-left'));
|
|
$this->addComponent(new GridFieldToolbarHeader());
|
|
$this->addComponent($sort = new GridFieldSortableHeader());
|
|
$this->addComponent($filter = new GridFieldFilterHeader());
|
|
$this->addComponent(new GridFieldDataColumns());
|
|
$this->addComponent(new GridFieldEditButton());
|
|
$this->addComponent(new GridFieldDeleteAction(true));
|
|
$this->addComponent(new GridField_ActionMenu());
|
|
$this->addComponent(new GridFieldPageCount('toolbar-header-right'));
|
|
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
|
$this->addComponent(new GridFieldDetailForm());
|
|
|
|
$sort->setThrowExceptionOnBadDataType(false);
|
|
$filter->setThrowExceptionOnBadDataType(false);
|
|
$pagination->setThrowExceptionOnBadDataType(false);
|
|
|
|
$this->extend('updateConfig');
|
|
}
|
|
}
|