\GridFieldAddOrderItem
A specific gridfield field designed to allow the creation of a new order item and that auto completes all fields from a pre-defined object (default Product).
- Author: ilateral <info@ilateral.co.uk>
Synopsis
class GridFieldAddOrderItem
implements
GridField_ActionProvider,GridField_HTMLProvider,GridField_URLHandler
{
- // members
- protected $targetFragment;
- protected string $dataObjectField = "Title";
- protected string $results_format = '$Title';
- protected string $source_class = "Product";
- protected boolean $strict_filter = true;
- protected array $filter_fields = ;
- protected array $autocomplete_fields = ;
- protected String $create_field = "Title";
- protected array $source_fields = ;
- protected integer $results_limit = 20;
- // methods
- public void getSourceClass()
- public void setSourceClass()
- public boolean getStrictFilter()
- public void setStrictFilter()
- public void getFilterFields()
- public void setFilterFields()
- public void getAutocompleteFields()
- public void setAutocompleteFields()
- public void getCreateField()
- public void setCreateField()
- public void getSourceFields()
- public void setSourceFields()
- public void getResultsLimit()
- public void setResultsLimit()
- public void __construct()
- public array getURLHandlers()
- public array getActions()
- public void handleAction()
- public string getHTMLFragments()
- public void doSearch()
- public string getDataObjectField()
- public void setDataObjectField()
Hierarchy
Implements
- GridField_ActionProvider
- GridField_HTMLProvider
- GridField_URLHandler
Members
protected
- $autocomplete_fields
—
array
Fields that we use to filter items for our autocomplete - $create_field
—
String
If filter fails, set this field when creating - $dataObjectField
—
string
Default field to create the dataobject by should be Title. - $filter_fields
—
array
Fields that we try and find our source object based on - $results_format — string
- $results_limit
—
int
Number of results to appear in autocomplete - $source_class
—
string
Default field to create the dataobject from. - $source_fields
—
array
Fields that we are mapping from the source object to our item - $strict_filter
—
boolean
When we check for existing items, should we check based on all filters or any of the chosen (setting this to true uses $list->filter() where as false uses $list->filterAny()) - $targetFragment
—
string
HTML Fragment to render the field.
Methods
public
- __construct()
- doSearch() — Returns a json array of a search results that can be used by for example Jquery.ui.autosuggestion
- getActions() — Provide actions to this component.
- getAutocompleteFields()
- getCreateField()
- getDataObjectField() — Returns the database field for which we'll add the new data object.
- getFilterFields()
- getHTMLFragments() — Renders the TextField and add button to the GridField.
- getResultsLimit()
- getSourceClass()
- getSourceFields()
- getStrictFilter() — Getter for strict_filter param
- getURLHandlers()
- handleAction() — Handles the add action for the given DataObject
- setAutocompleteFields()
- setCreateField()
- setDataObjectField() — Set the database field.
- setFilterFields()
- setResultsLimit()
- setSourceClass()
- setSourceFields()
- setStrictFilter() — Setter for strict_filter param