GridFieldDataColumns
class GridFieldDataColumns implements GridField_ColumnProvider
Properties
array | $fieldCasting | ||
array | $fieldFormatting |
Methods
Modify the list of columns displayed in the table.
Override the default behaviour of showing the models summaryFields with these fields instead Example: array( 'Name' => 'Members name', 'Email' => 'Email address')
Get the DisplayFields
Specify castings with fieldname as the key, and the desired casting as value.
No description
Specify custom formatting for fields, e.g. to render a link instead of pure text.
No description
HTML for the column, content of the element.
Attributes for the element containing the content returned by {@link getColumnContent()}.
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 34
augmentColumns(GridField $gridField, array $columns)
Modify the list of columns displayed in the table.
See {@link GridFieldDataColumns->getDisplayFields()} and {@link GridFieldDataColumns}.
at line 50
array
getColumnsHandled(GridField $gridField)
Names of all columns which are affected by this component.
at line 61
setDisplayFields(array $fields)
Override the default behaviour of showing the models summaryFields with these fields instead Example: array( 'Name' => 'Members name', 'Email' => 'Email address')
at line 76
array
getDisplayFields($gridField)
Get the DisplayFields
at line 89
setFieldCasting(array $casting)
Specify castings with fieldname as the key, and the desired casting as value.
Example: array("MyCustomDate"=>"Date","MyShortText"=>"Text->FirstSentence")
at line 97
array
getFieldCasting()
at line 115
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.
at line 123
array
getFieldFormatting()
at line 135
string
getColumnContent(GridField $gridField, DataObject $record, string $columnName)
HTML for the column, content of the element.
at line 168
array
getColumnAttributes(GridField $gridField, DataObject $record, string $columnName)
Attributes for the element containing the content returned by {@link getColumnContent()}.
at line 180
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.