mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT SSF-168 moved print and csv export buttons to the top of the grid
This commit is contained in:
parent
4ffef20b09
commit
7740bb326a
@ -115,7 +115,7 @@ abstract class ModelAdmin extends LeftAndMain {
|
||||
|
||||
function getEditForm($id = null) {
|
||||
$list = $this->getList();
|
||||
$exportButton = new GridFieldExportButton();
|
||||
$exportButton = new GridFieldExportButton('before');
|
||||
$exportButton->setExportColumns($this->getExportFields());
|
||||
$listField = Object::create('GridField',
|
||||
$this->modelClass,
|
||||
@ -124,7 +124,7 @@ abstract class ModelAdmin extends LeftAndMain {
|
||||
$fieldConfig = GridFieldConfig_RecordEditor::create($this->stat('page_length'))
|
||||
->addComponent($exportButton)
|
||||
->removeComponentsByType('GridFieldFilterHeader')
|
||||
->addComponents(new GridFieldPrintButton())
|
||||
->addComponents(new GridFieldPrintButton('before'))
|
||||
);
|
||||
|
||||
// Validation
|
||||
|
@ -52,7 +52,7 @@ class GridFieldPrintButton implements GridField_HTMLProvider, GridField_ActionPr
|
||||
$button->addExtraClass('gridfield-button-print');
|
||||
//$button->addExtraClass('no-ajax');
|
||||
return array(
|
||||
$this->targetFragment => '<p class="grid-print-button">' . $button->Field() . '</p>',
|
||||
$this->targetFragment => '<p class="grid-print-button">' . $button->Field() . '</p>',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -96,8 +96,8 @@ class Group extends DataObject {
|
||||
|
||||
if($this->ID) {
|
||||
$config = new GridFieldConfig_RelationEditor();
|
||||
$config->addComponents(new GridFieldExportButton());
|
||||
$config->addComponents(new GridFieldPrintButton());
|
||||
$config->addComponents(new GridFieldExportButton('before'));
|
||||
$config->addComponents(new GridFieldPrintButton('before'));
|
||||
$config->getComponentByType('GridFieldAddExistingAutocompleter')
|
||||
->setResultsFormat('$Title ($Email)')->setSearchFields(array('FirstName', 'Surname', 'Email'));
|
||||
$config->getComponentByType('GridFieldDetailForm')->setValidator(new Member_Validator());
|
||||
|
Loading…
Reference in New Issue
Block a user