interface GridField_ColumnProvider implements GridFieldComponent

Add a new column to the table display body, or modify existing columns.

Used once per record/row.

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.

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 $columnName)

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 23
augmentColumns(GridField $gridField, array $columns)

Modify the list of columns displayed in the table.

Parameters

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

See also

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

at line 31
array getColumnsHandled(GridField $gridField)

Names of all columns which are affected by this component.

Parameters

GridField $gridField

Return Value

array

at line 41
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 51
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 61
array getColumnMetadata(GridField $gridField, string $columnName)

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 $columnName

Return Value

array
  • Map of arbitrary metadata identifiers to their values.