silverstripe-blog/forms/gridfield/GridFieldConfig_AddByDBField.php
2013-07-21 11:23:35 +01:00

15 lines
430 B
PHP
Executable File

<?php
class GridFieldConfig_AddByDBField extends GridFieldConfig_RecordEditor {
public function __construct($itemsPerPage = null, $dataObjectField = "Title") {
parent::__construct($itemsPerPage);
// Remove uneccesary components
$this->removeComponentsByType("GridFieldAddNewButton");
// Add new components
$this->addComponent(new GridFieldAddByDBField("buttons-before-left", $dataObjectField));
}
}