Milkyway\SS\GridFieldUtils\AddNewOrExistingInlineButton
Synopsis
class AddNewOrExistingInlineButton
extends GridFieldAddNewInlineButton
implements
GridField_ColumnProvider
{
- // members
- public string $refField = 'Title';
- public string $valField = 'ID';
- public string $valFieldAfterSave = 'Title';
- public Closure $valFieldCallback;
- public DataList $list;
- public boolean $allowNewItems = true;
- public boolean $hasEmptyDefault = true;
- public array $additionalData = ;
- // methods
- public void __construct()
- public void handleSave()
- public void augmentColumns()
- public array getColumnAttributes()
- public string getColumnContent()
- public void getColumnField()
- public array getColumnMetadata()
- public array getColumnsHandled()
- public void getHTMLFragments()
- protected void getValFieldAfterSaveFormField()
- private void getRowTemplate()
- private void addFallbackValueToDisplayFields()
Hierarchy
Extends
- GridFieldAddNewInlineButton
Implements
- GridField_ColumnProvider
Members
public
- $additionalData — boolean
- $allowNewItems — boolean
- $hasEmptyDefault — boolean
- $list — \DataList
- $refField — string
- $valField — string
- $valFieldAfterSave — string
- $valFieldCallback — Milkyway\SS\GridFieldUtils\string|callable|\Closure
Methods
private
- addFallbackValueToDisplayFields() — This will add the fallback value (val field after save) to the display fields component, so it can be saved by @GridFieldEditableColumns
- getRowTemplate()
protected
public
- __construct()
- augmentColumns() — Modify the list of columns displayed in the table.
- getColumnAttributes() — Attributes for the element containing the content returned by {@link getColumnContent()}.
- getColumnContent()
- getColumnField()
- 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.
- getHTMLFragments()
- handleSave() — If the record exists, will use the valFieldAfterSave callback, otherwise it will try to find an object by ID, and if it can't it will save to valFieldAfterSave