class GridFieldDataColumns implements GridField_ColumnProvider

Properties

array $fieldCasting
array $fieldFormatting

Methods

augmentColumns(GridField $gridField, array $columns)

Modify the list of columns displayed in the table.

array
getColumnsHandled(GridField $gridField)

Names of all columns which are affected by this component.

$this
setDisplayFields(array $fields)

Override the default behaviour of showing the models summaryFields with these fields instead Example: array( 'Name' => 'Members name', 'Email' => 'Email address')

array
getDisplayFields(GridField $gridField)

Get the DisplayFields

$this
setFieldCasting(array $casting)

Specify castings with fieldname as the key, and the desired casting as value.

array
getFieldCasting()

No description

$this
setFieldFormatting(array $formatting)

Specify custom formatting for fields, e.g. to render a link instead of pure text.

array
getFieldFormatting()

No description

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

HTML for the column, content of the element.

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

Attributes for the element containing the content returned by {@link getColumnContent()}.

array
getColumnMetadata(GridField $gridField, string $column)

Additional metadata about the column which can be used by other components, e.g. to set a title for a search column header.

Details

at line 39
augmentColumns(GridField $gridField, array $columns)

Modify the list of columns displayed in the table.

See {@link GridFieldDataColumns->getDisplayFields()} and {@link GridFieldDataColumns}.

Parameters

GridField $gridField
array $columns List reference of all column names.

at line 56
array getColumnsHandled(GridField $gridField)

Names of all columns which are affected by this component.

Parameters

GridField $gridField

Return Value

array

at line 69
$this setDisplayFields(array $fields)

Override the default behaviour of showing the models summaryFields with these fields instead Example: array( 'Name' => 'Members name', 'Email' => 'Email address')

Parameters

array $fields

Return Value

$this

at line 87
array getDisplayFields(GridField $gridField)

Get the DisplayFields

Parameters

GridField $gridField

Return Value

array

See also

GridFieldDataColumns::setDisplayFields

at line 102
$this setFieldCasting(array $casting)

Specify castings with fieldname as the key, and the desired casting as value.

Example: array("MyCustomDate"=>"Date","MyShortText"=>"Text->FirstSentence")

Parameters

array $casting

Return Value

$this

at line 111
array getFieldCasting()

Return Value

array

at line 131
$this setFieldFormatting(array $formatting)

Specify custom formatting for fields, e.g. to render a link instead of pure text.

Caution: Make sure to escape special php-characters like in a normal php-statement. Example: "myFieldName" => '$ID'.

Alternatively, pass a anonymous function, which takes two parameters: The value and the original list item.

Formatting is applied after field casting, so if you're modifying the string to include further data through custom formatting, ensure it's correctly escaped.

Parameters

array $formatting

Return Value

$this

at line 140
array getFieldFormatting()

Return Value

array

at line 153
string getColumnContent(GridField $gridField, DataObject $record, string $columnName)

HTML for the column, content of the element.

Parameters

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

Return Value

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

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

Attributes for the element containing the content returned by {@link getColumnContent()}.

Parameters

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

Return Value

array

at line 200
array getColumnMetadata(GridField $gridField, string $column)

Additional metadata about the column which can be used by other components, e.g. to set a title for a search column header.

Parameters

GridField $gridField
string $column

Return Value

array
  • Map of arbitrary metadata identifiers to their values.