class GridFieldBulkManager implements GridField_HTMLProvider, GridField_ColumnProvider, GridField_URLHandler (View source)

GridField component for editing attached models in bulk.

Properties

protected array $config

component configuration.

Methods

public
__construct(array $editableFields = null, bool $defaultActions = true)

GridFieldBulkManager component constructor.

public
setConfig(string $reference, mixed $value)

Sets the component configuration parameter.

public
mixed
getConfig(string $reference = false)

Returns one $config parameter of the full $config.

public
addBulkAction(string $name, string $label = null, string $handler = null, array $config = null)

Lets you add custom bulk actions to the bulk manager interface.

public
removeBulkAction(string $name)

Removes a bulk actions from the bulk manager interface.

public
augmentColumns(GridField $gridField, array $columns)

Add bulk select column.

public
array
getColumnsHandled(GridField $gridField)

Which columns are handled by the component.

public
string
getColumnContent(GridField $gridField, DataObject $record, string $columnName)

Sets the column's content.

public
array
getColumnAttributes(GridField $gridField, DataObject $record, string $columnName)

Set the column's HTML attributes.

public
array
getColumnMetadata(GridField $gridField, string $columnName)

Set the column's meta data.

public
array
getHTMLFragments($gridField)

No description

public
getURLHandlers($gridField)

Returns an action => handler list.

public
mixed
handleBulkAction(GridField $gridField, SS_HTTPRequest $request)

Pass control over to the RequestHandler loop through the handlers provided in config['actions'] and find matching url_handlers.

Details

__construct(array $editableFields = null, bool $defaultActions = true)

GridFieldBulkManager component constructor.

Parameters

array $editableFields

List of editable fields

bool $defaultActions

Use default actions list. False to start fresh.

setConfig(string $reference, mixed $value)

Sets the component configuration parameter.

Parameters

string $reference
mixed $value

mixed getConfig(string $reference = false)

Returns one $config parameter of the full $config.

Parameters

string $reference

$congif parameter to return

Return Value

mixed

GridFieldBulkManager addBulkAction(string $name, string $label = null, string $handler = null, array $config = null)

Lets you add custom bulk actions to the bulk manager interface.

add config options for front-end: isAjax, icon

Parameters

string $name

Bulk action's name. Used by RequestHandler.

string $label

Dropdown menu action's label. Default to ucfirst($name).

string $handler

RequestHandler class name for this action. Default to 'GridFieldBulkAction'.ucfirst($name).'Handler'

array $config

Front-end configuration array( 'isAjax' => true, 'icon' => 'accept', 'isDestructive' => false )

Return Value

GridFieldBulkManager

Current GridFieldBulkManager instance

GridFieldBulkManager removeBulkAction(string $name)

Removes a bulk actions from the bulk manager interface.

Parameters

string $name

Bulk action's name

Return Value

GridFieldBulkManager

Current GridFieldBulkManager instance

augmentColumns(GridField $gridField, array $columns)

Add bulk select column.

Parameters

GridField $gridField
array $columns

List of columns

array getColumnsHandled(GridField $gridField)

Which columns are handled by the component.

Parameters

GridField $gridField

Return Value

array

string getColumnContent(GridField $gridField, DataObject $record, string $columnName)

Sets the column's content.

Parameters

GridField $gridField
DataObject $record
  • Record displayed in this row
string $columnName

Return Value

string
  • HTML for the column. Return NULL to skip.

array getColumnAttributes(GridField $gridField, DataObject $record, string $columnName)

Set the column's HTML attributes.

Parameters

GridField $gridField
DataObject $record

displayed in this row

string $columnName

Return Value

array

array getColumnMetadata(GridField $gridField, string $columnName)

Set the column's meta data.

Parameters

GridField $gridField
string $columnName

Return Value

array
  • Map of arbitrary metadata identifiers to their values.

array getHTMLFragments($gridField)

No description

Parameters

$gridField

Return Value

array

getURLHandlers($gridField)

Returns an action => handler list.

Parameters

$gridField

mixed handleBulkAction(GridField $gridField, SS_HTTPRequest $request)

Pass control over to the RequestHandler loop through the handlers provided in config['actions'] and find matching url_handlers.

$url_handlers rule should not use wildcards like '$Action' => '$Action' but have more specific path defined

Parameters

GridField $gridField
SS_HTTPRequest $request

Return Value

mixed