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

A button you can add to a GridField to export that GridField as a CSV. Should work with any sized GridField, as the export is done using a queuedjob in the background.

Properties

protected array $exportColumns
protected string $csvSeparator
protected bool $csvHasHeader
protected $targetFragment

Fragment to write the button to

Methods

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

No description

public
array
getHTMLFragments($gridField)

Place the export button in a

tag below the field

public
array
getActions($gridField)

This class is an action button

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

Handle an action on the given GridField.

public
startExport($gridField)

No description

public
getURLHandlers($gridField)

This class is also a URL handler

protected
getExportPath($id)

No description

public
checkExport($gridField, $request = null)

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

public
downloadExport($gridField, $request = null)

No description

public
array
getExportColumns()

No description

public
setExportColumns($cols)

No description

public
string
getCsvSeparator()

No description

public
setCsvSeparator($separator)

No description

public
bool
getCsvHasHeader()

No description

public
setCsvHasHeader($bool)

No description

Details

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

No description

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)

This class 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 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

startExport($gridField)

No description

Parameters

$gridField

getURLHandlers($gridField)

This class is also a URL handler

Parameters

$gridField

protected getExportPath($id)

No description

Parameters

$id

checkExport($gridField, $request = null)

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

Parameters

$gridField
$request

downloadExport($gridField, $request = null)

No description

Parameters

$gridField
$request

array getExportColumns()

No description

Return Value

array

setExportColumns($cols)

No description

Parameters

$cols

string getCsvSeparator()

No description

Return Value

string

setCsvSeparator($separator)

No description

Parameters

$separator

bool getCsvHasHeader()

No description

Return Value

bool

setCsvHasHeader($bool)

No description

Parameters

$bool