\GridFieldExcelExportAction
Gridfield component that can be added to a Gridfield to allow a user to export a single DataObject to Excel.
Based of .
Synopsis
class GridFieldExcelExportAction
implements
GridField_ColumnProvider,GridField_ActionProvider
{
- // members
- protected $exportType;
- protected bool $useLabelsAsHeaders = NULL;
- // methods
- public void __construct()
- public void augmentColumns()
- public array getColumnAttributes()
- public array getColumnMetadata()
- public array getColumnsHandled()
- public array getActions()
- public string getColumnContent()
- public void handleAction()
- protected void setHeader()
- public GridFieldExcelExportButton setUseLabelsAsHeaders()
- public bool|null getUseLabelsAsHeaders()
Hierarchy
Implements
- GridField_ColumnProvider
- GridField_ActionProvider
Members
protected
- $exportType
—
string
The type of file we will be exporting - $useLabelsAsHeaders
—
bool
Whatever to override the default $useFieldLabelsAsHeaders value for the DataFormatter.
Methods
protected
- setHeader() — Helper function for building the right header to get the file downloaded.
public
- __construct() — Instanciate a new GridFieldExcelExportAction
- augmentColumns() — Add a column at the end of the grid field if need be
- getActions() — Which GridField actions are this component handling
- getColumnAttributes() — Return any special attributes that will be used for FormField::create_tag()
- getColumnContent() — Return the button to show at the end of the row
- getColumnMetadata() — Add the title
- getColumnsHandled() — Which columns are handled by this component
- getUseLabelsAsHeaders() — Return the value that will be assigned to the DataFormatter's UseFieldLabelsAsHeaders property
- handleAction() — Handle the actions and apply any changes to the GridField
- setUseLabelsAsHeaders() — Set the DataFormatter's UseFieldLabelsAsHeaders property