Skip to content
This repository
Browse code

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

…the grid
  • Loading branch information...
commit 7740bb326a54a8ec1809607c4aab2953bcca6046 1 parent 4ffef20
Felipe authored April 04, 2012
4  admin/code/ModelAdmin.php
@@ -115,7 +115,7 @@ public function init() {
115 115
 
116 116
 	function getEditForm($id = null) {
117 117
 		$list = $this->getList();
118  
-		$exportButton = new GridFieldExportButton();
  118
+		$exportButton = new GridFieldExportButton('before');
119 119
 		$exportButton->setExportColumns($this->getExportFields());
120 120
 		$listField = Object::create('GridField',
121 121
 			$this->modelClass,
@@ -124,7 +124,7 @@ function getEditForm($id = null) {
124 124
 			$fieldConfig = GridFieldConfig_RecordEditor::create($this->stat('page_length'))
125 125
 				->addComponent($exportButton)
126 126
 				->removeComponentsByType('GridFieldFilterHeader')
127  
-				->addComponents(new GridFieldPrintButton())
  127
+				->addComponents(new GridFieldPrintButton('before'))
128 128
 		);
129 129
 
130 130
 		// Validation
2  forms/gridfield/GridFieldPrintButton.php
@@ -52,7 +52,7 @@ public function getHTMLFragments($gridField) {
52 52
 		$button->addExtraClass('gridfield-button-print');
53 53
 		//$button->addExtraClass('no-ajax');
54 54
 		return array(
55  
-			$this->targetFragment => '<p class="grid-print-button">' . $button->Field() . '</p>',
  55
+			$this->targetFragment => '<p class="grid-print-button">' . $button->Field() . '</p>', 
56 56
 		);
57 57
 	}
58 58
 
4  security/Group.php
@@ -96,8 +96,8 @@ public function getCMSFields() {
96 96
 
97 97
 		if($this->ID) {
98 98
 			$config = new GridFieldConfig_RelationEditor();
99  
-			$config->addComponents(new GridFieldExportButton());
100  
-			$config->addComponents(new GridFieldPrintButton());
  99
+			$config->addComponents(new GridFieldExportButton('before'));
  100
+			$config->addComponents(new GridFieldPrintButton('before'));
101 101
 			$config->getComponentByType('GridFieldAddExistingAutocompleter')
102 102
 				->setResultsFormat('$Title ($Email)')->setSearchFields(array('FirstName', 'Surname', 'Email'));
103 103
 			$config->getComponentByType('GridFieldDetailForm')->setValidator(new Member_Validator());

0 notes on commit 7740bb3

Please sign in to comment.
Something went wrong with that request. Please try again.