SilverCart\Admin\Forms\GridField\GridFieldSubObjectHandler
GridField Component to handle sub objects of the GridFields base object.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class GridFieldSubObjectHandler
implements
GridField_HTMLProvider,GridField_ActionProvider,GridField_URLHandler,GridField_ColumnProvider
{
- // members
- protected DataObject $parentObject;
- protected $targetClassName;
- protected DataList $subList;
- protected $URLHandlers = NULL;
- protected string $subListTemplate = 'GridFieldSubObjectHandler_sublist';
- // methods
- public void __construct()
- public string getSubListTemplate()
- public void setSubListTemplate()
- public DataList getSubObjects()
- public DropdownField getDropdownField()
- public string getAddSubObjectColumnName()
- protected string getNameFromParent()
- public array getHTMLFragments()
- public array getActions()
- public string handleAction()
- public array getURLHandlers()
- public void augmentColumns()
- public array getColumnsHandled()
- public string getColumnContent()
- public array getColumnAttributes()
- public array getColumnMetadata()
Hierarchy
Implements
- SilverStripe\Forms\GridField\GridField_HTMLProvider
- SilverStripe\Forms\GridField\GridField_ActionProvider
- SilverStripe\Forms\GridField\GridField_URLHandler
- SilverStripe\Forms\GridField\GridField_ColumnProvider
Members
protected
- $URLHandlers
—
array
URL handlers - $parentObject
—
SilverStripe\ORM\DataObject
Parent object - $subList
—
SilverStripe\ORM\DataList
Sublist - $subListTemplate
—
string
Name of the sub list template - $targetClassName
—
string
Class name to add actions for
Methods
protected
- getNameFromParent() — Calculate the name of the gridfield relative to the Form
public
- __construct() — Sets the defaults.
- augmentColumns() — Modify the list of columns displayed in the table.
- getActions() — Returns the actions handled by this component.
- getAddSubObjectColumnName() — Returns the columns name for the sub object column.
- getColumnAttributes() — Attributes for the element containing the content returned by {@link getColumnContent()}.
- getColumnContent() — HTML for the column, content of the <td> element.
- getColumnMetadata() — Additional metadata about the column which can be used by other components, e.g. to set a title for a search column header.
- getColumnsHandled() — Names of all columns which are affected by this component.
- getDropdownField() — Returns the DropdownField to choose sub objects from.
- getHTMLFragments() — Adds the form fields for the batch actions
- getSubListTemplate() — Returns the sub list template name.
- getSubObjects() — Returns the related sub objects.
- getURLHandlers() — Returns the URL handlers for the batch actions.
- handleAction() — Handles the given action context.
- setSubListTemplate() — Sets the sub list template name.