/** * Place the export button in a <p> tag below the field */ public function getHTMLFragments($gridField) { $button = new GridField_FormAction($gridField, 'excelexport', _t('TableListField.XLSEXPORT', 'Export to Excel'), 'excelexport', null); $button->setAttribute('data-icon', 'download-excel'); $button->addExtraClass('no-ajax action_export'); $button->setForm($gridField->getForm()); return array($this->targetFragment => '<p class="grid-excel-button">' . $button->Field() . '</p>'); }