Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT SSF-168 moved print and csv export buttons to the top of …

…the grid
  • Loading branch information...
commit 7740bb326a54a8ec1809607c4aab2953bcca6046 1 parent 4ffef20
@felipesilverstripe felipesilverstripe authored
View
4 admin/code/ModelAdmin.php
@@ -115,7 +115,7 @@ public function init() {
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 @@ function getEditForm($id = null) {
$fieldConfig = GridFieldConfig_RecordEditor::create($this->stat('page_length'))
->addComponent($exportButton)
->removeComponentsByType('GridFieldFilterHeader')
- ->addComponents(new GridFieldPrintButton())
+ ->addComponents(new GridFieldPrintButton('before'))
);
// Validation
View
2  forms/gridfield/GridFieldPrintButton.php
@@ -52,7 +52,7 @@ public function getHTMLFragments($gridField) {
$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>',
);
}
View
4 security/Group.php
@@ -96,8 +96,8 @@ public function getCMSFields() {
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());
Please sign in to comment.
Something went wrong with that request. Please try again.