Skip to content

Commit

Permalink
ENHANCEMENT SSF-168 moved print and csv export buttons to the top of …
Browse files Browse the repository at this point in the history
…the grid
  • Loading branch information
felipesilverstripe committed Apr 4, 2012
1 parent 4ffef20 commit 7740bb3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions admin/code/ModelAdmin.php
Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion forms/gridfield/GridFieldPrintButton.php
Expand Up @@ -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>',
);
}

Expand Down
4 changes: 2 additions & 2 deletions security/Group.php
Expand Up @@ -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());
Expand Down

0 comments on commit 7740bb3

Please sign in to comment.