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 $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}.

array
getURLHandlers(GridField $gridField)

it is also a URL

handleExport(GridField $gridField, HTTPRequest $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

$this
setExportColumns(array $cols)

No description

string
getCsvSeparator()

No description

$this
setCsvSeparator(string $separator)

No description

string
getCsvEnclosure()

No description

$this
setCsvEnclosure(string $enclosure)

No description

boolean
getCsvHasHeader()

No description

$this
setCsvHasHeader(boolean $bool)

No description

Details

at line 55
__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 68
array getHTMLFragments(GridField $gridField)

Place the export button in a

<

p> tag below the field

Parameters

GridField $gridField

Return Value

array

at line 91
array getActions(GridField $gridField)

export is an action button

Parameters

GridField $gridField

Return Value

array with action identifier strings.

at line 96
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 111
array getURLHandlers(GridField $gridField)

it is also a URL

Parameters

GridField $gridField

Return Value

array

at line 126
HTTPResponse handleExport(GridField $gridField, HTTPRequest $request = null)

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

Parameters

GridField $gridField
HTTPRequest $request

Return Value

HTTPResponse

at line 166
string generateExportFileData(GridField $gridField)

Generate export fields for CSV.

Parameters

GridField $gridField

Return Value

string

at line 266
array getExportColumns()

Return Value

array

at line 276
$this setExportColumns(array $cols)

Parameters

array $cols

Return Value

$this

at line 285
string getCsvSeparator()

Return Value

string

at line 295
$this setCsvSeparator(string $separator)

Parameters

string $separator

Return Value

$this

at line 304
string getCsvEnclosure()

Return Value

string

at line 314
$this setCsvEnclosure(string $enclosure)

Parameters

string $enclosure

Return Value

$this

at line 323
boolean getCsvHasHeader()

Return Value

boolean

at line 333
$this setCsvHasHeader(boolean $bool)

Parameters

boolean $bool

Return Value

$this