BUG: export and print buttons outside button row

Export and print buttons are appearing outside the button row in model admin, meaning that if the add button is removed (say, by removing the create permission), the buttons are flush with the gridfield.
This commit is contained in:
Naomi Guyer 2015-03-26 14:08:46 +13:00
parent d71e2ea552
commit 636cddb4bc

View File

@ -137,7 +137,7 @@ abstract class ModelAdmin extends LeftAndMain {
public function getEditForm($id = null, $fields = null) {
$list = $this->getList();
$exportButton = new GridFieldExportButton('before');
$exportButton = new GridFieldExportButton('buttons-before-left');
$exportButton->setExportColumns($this->getExportFields());
$listField = GridField::create(
$this->sanitiseClassName($this->modelClass),
@ -146,7 +146,7 @@ abstract class ModelAdmin extends LeftAndMain {
$fieldConfig = GridFieldConfig_RecordEditor::create($this->stat('page_length'))
->addComponent($exportButton)
->removeComponentsByType('GridFieldFilterHeader')
->addComponents(new GridFieldPrintButton('before'))
->addComponents(new GridFieldPrintButton('buttons-before-left'))
);
// Validation