class GridFieldExportButton implements GridField_HTMLProvider, GridField_ActionProvider, GridField_URLHandler

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

Config options

xls_export_disabled bool 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

<

p> tag below the field

Array
getActions(GridField $gridField)

export is an action button

handleAction(GridField $gridField, String $actionName, Array $arguments, Array $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(array $cols)

No description

string
getCsvSeparator()

No description

setCsvSeparator(string $separator)

No description

boolean
getCsvHasHeader()

No description

setCsvHasHeader(boolean $bool)

No description

Details

at line 46
__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

at line 54
array getHTMLFragments($gridField)

Place the export button in a

<

p> tag below the field

Parameters

$gridField

Return Value

array

at line 73
Array getActions(GridField $gridField)

export is an action button

Parameters

GridField $gridField

Return Value

Array with action identifier strings.

at line 77
handleAction(GridField $gridField, String $actionName, Array $arguments, Array $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
String $actionName Action identifier, see {@link getActions()}.
Array $arguments Arguments relevant for this
Array $data All form data

at line 86
getURLHandlers($gridField)

it is also a URL

Parameters

$gridField

at line 95
handleExport($gridField, $request = null)

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

Parameters

$gridField
$request

at line 129
string generateExportFileData(GridField $gridField)

Generate export fields for CSV.

Parameters

GridField $gridField

Return Value

string

at line 215
array getExportColumns()

Return Value

array

at line 222
setExportColumns(array $cols)

Parameters

array $cols

at line 230
string getCsvSeparator()

Return Value

string

at line 237
setCsvSeparator(string $separator)

Parameters

string $separator

at line 245
boolean getCsvHasHeader()

Return Value

boolean

at line 252
setCsvHasHeader(boolean $bool)

Parameters

boolean $bool