targetFragment = $targetFragment; $this->importFormField = $importFormField; } /** * Place the export button in a
tag below the field * * @param GridField $gridField * @return array */ public function getHTMLFragments($gridField) { $button = new GridField_FormAction( $gridField, 'import', _t('TableListField.CSVIMPORT', 'Import CSV'), 'import', null ); $button->addExtraClass('btn btn-secondary no-ajax font-icon-upload btn--icon-large action_import'); // means that you can only have 1 import per page $button ->setAttribute('data-toggle', "modal") ->setAttribute('data-target', "#". $gridField->getForm()->getHTMLID() . '_ImportModal'); $button->setForm($gridField->getForm()); $extra = null; return array( $this->targetFragment => '
' ); } /** * export is an action button * * @param GridField $gridField * @return array */ public function getActions($gridField) { return []; } }