class GridFieldExportButton implements GridField_HTMLProvider, GridField_ActionProvider, GridField_URLHandler (View source)

Adds an "Export list" button to the bottom of a {@link GridField}.

Properties

static private bool $xls_export_disabled

Set to true to disable XLS sanitisation [SS-2017-007] Ensure all cells with leading [@=+] have a leading tab

Methods

__construct(string $targetFragment = "after", array $exportColumns = null)

No description

array
getHTMLFragments($gridField)

Place the export button in a

tag below the field

array
getActions($gridField)

export is an action button

handleAction(GridField $gridField, $actionName, $arguments, $data)

Handle an action on the given {@link GridField}.

getURLHandlers($gridField)

it is also a URL

handleExport($gridField, $request = null)

Handle the export, for both the action button and the URL

string
generateExportFileData(GridField $gridField)

Generate export fields for CSV.

array
getExportColumns()

No description

setExportColumns($cols)

No description

string
getCsvSeparator()

No description

setCsvSeparator($separator)

No description

bool
getCsvHasHeader()

No description

setCsvHasHeader($bool)

No description

Details

__construct(string $targetFragment = "after", array $exportColumns = null)

Parameters

string $targetFragment

The HTML fragment to write the button into

array $exportColumns

The columns to include in the export

array getHTMLFragments($gridField)

Place the export button in a

tag below the field

Parameters

$gridField

Return Value

array

array getActions($gridField)

export is an action button

Parameters

$gridField

Return Value

array

with action identifier strings.

handleAction(GridField $gridField, $actionName, $arguments, $data)

Handle an action on the given {@link GridField}.

Calls ALL components for every action handled, so the component needs to ensure it only accepts actions it is actually supposed to handle.

Parameters

GridField $gridField
$actionName
$arguments
$data

getURLHandlers($gridField)

it is also a URL

Parameters

$gridField

handleExport($gridField, $request = null)

Handle the export, for both the action button and the URL

Parameters

$gridField
$request

string generateExportFileData(GridField $gridField)

Generate export fields for CSV.

Parameters

GridField $gridField

Return Value

string

array getExportColumns()

Return Value

array

setExportColumns($cols)

Parameters

$cols

string getCsvSeparator()

Return Value

string

setCsvSeparator($separator)

Parameters

$separator

bool getCsvHasHeader()

Return Value

bool

setCsvHasHeader($bool)

Parameters

$bool