GridFieldExternalLink
class GridFieldExternalLink extends GridFieldDataColumns (View source)
Displays a link to an external source referenced 'external link'
Properties
public | array | $fieldCasting | from GridFieldDataColumns | |
public | array | $fieldFormatting | from GridFieldDataColumns | |
protected | array | $displayFields | This is the columns that will be visible |
from GridFieldDataColumns |
Methods
Override the default behaviour of showing the models summaryFields with these fields instead Example: array( 'Name' => 'Members name', 'Email' => 'Email address')
Specify castings with fieldname as the key, and the desired casting as value.
Specify custom formatting for fields, e.g. to render a link instead of pure text.
Return any special attributes that will be used for FormField::create_tag()
Translate a Object.RelationName.ColumnName $columnName into the value that ColumnName returns
Casts a field to a string which is safe to insert into HTML
No description
Remove values from a value using FieldEscape setter
Details
augmentColumns(GridField $gridField, array $columns)
Add a column for the actions
array
getColumnsHandled(GridField $gridField)
Which columns are handled by this component
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)
Get the DisplayFields
setFieldCasting(array $casting)
Specify castings with fieldname as the key, and the desired casting as value.
Example: array("MyCustomDate"=>"Date","MyShortText"=>"Text->FirstSentence")
array
getFieldCasting()
No description
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" => '<a href=\"custom-admin/$ID\">$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.
array
getFieldFormatting()
No description
string
getColumnContent(GridField $gridField, DataObject $record, string $columnName)
No description
array
getColumnAttributes(GridField $gridField, DataObject $record, string $columnName)
Return any special attributes that will be used for FormField::create_tag()
array
getColumnMetadata(GridField $gridField, string $columnName)
Add the title
protected string|null
getValueFromRelation(DataObject $record, string $columnName)
Translate a Object.RelationName.ColumnName $columnName into the value that ColumnName returns
protected string
castValue(GridField $gridField, string $fieldName, string $value)
Casts a field to a string which is safe to insert into HTML
protected string
formatValue(GridField $gridField, DataObject $item, string $fieldName, string $value)
No description
protected string
escapeValue(GridField $gridField, string $value)
Remove values from a value using FieldEscape setter