LeKoala\ExcelImportExport\ExcelGridFieldExportButton
Adds an "Export list" button to the bottom of a {@link GridField}.
Synopsis
class ExcelGridFieldExportButton
implements
GridField_HTMLProvider,GridField_ActionProvider,GridField_URLHandler
{
- // members
- protected $exportColumns;
- protected $targetFragment;
- protected boolean $hasHeader = true;
- protected string $exportType = 'xlsx';
- protected $exportName = NULL;
- protected $buttonTitle = NULL;
- protected bool $checkCanView = true;
- protected array $listFilters = ;
- protected callable $afterExportCallback;
- protected static integer $instances = 0;
- protected $instance;
- // methods
- public void __construct()
- public void getActionName()
- public void getHTMLFragments()
- public void getActions()
- public void handleAction()
- public void getURLHandlers()
- public void handleExport()
- public Spreadsheet generateExportFileData()
- public array getExportColumns()
- public void setExportColumns()
- public boolean getHasHeader()
- public void setHasHeader()
- public string getExportType()
- public void setExportType()
- public string getExportName()
- public ExcelGridFieldExportButton setExportName()
- public string getButtonTitle()
- public ExcelGridFieldExportButton setButtonTitle()
- public bool getCheckCanView()
- public ExcelGridFieldExportButton setCheckCanView()
- public array getListFilters()
- public ExcelGridFieldExportButton setListFilters()
- public callable getAfterExportCallback()
- public ExcelGridFieldExportButton setAfterExportCallback()
Hierarchy
Implements
- SilverStripe\Forms\GridField\GridField_HTMLProvider
- SilverStripe\Forms\GridField\GridField_ActionProvider
- SilverStripe\Forms\GridField\GridField_URLHandler
Tasks
Line | Task |
---|---|
269 | should GridFieldComponents change behaviour based on whether others are available in the config? |
Members
protected
- $afterExportCallback — LeKoala\ExcelImportExport\callable
- $checkCanView — LeKoala\ExcelImportExport\bool
- $exportColumns — array
- $exportName — string
- $exportType — string
- $hasHeader — boolean
- $instance
—
int
Current instance count - $instances
—
int
Static instance counter to allow multiple instances to work together - $listFilters — array
-
$targetFragment
Fragment to write the button to
Methods
public
- __construct()
- generateExportFileData() — Generate export fields for Excel.
- getActionName()
- getActions() — export is an action button
- getAfterExportCallback()
- getButtonTitle()
- getCheckCanView()
- getExportColumns()
- getExportName()
- getExportType()
- getHTMLFragments() — Place the export button in a <p> tag below the field
- getHasHeader()
- getListFilters()
- getURLHandlers() — it is also a URL
- handleAction()
- handleExport() — Handle the export, for both the action button and the URL
- setAfterExportCallback()
- setButtonTitle()
- setCheckCanView()
- setExportColumns()
- setExportName()
- setExportType()
- setHasHeader()
- setListFilters()