GridFieldDropdownFilter
class GridFieldDropdownFilter implements GridField_HTMLProvider, GridField_ActionProvider, GridField_DataManipulator (View source)
GridFieldDropdownFilter provides a dropdown that can be used to filter a GridField arbitrarily
Constants
DEFAULT_OPTION_VALUE |
Default string used in the value http attribute on the option for all results |
Properties
protected | string | $name | ||
protected | string | $targetFragment | ||
protected | SS_List | $filterOptions | ||
protected | string | $defaultOption |
Methods
No description
Add an option to the dropdown that provides a filter
Handle an action on the given GridField.
Manipulate the DataList as needed by this grid modifier.
Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
Details
__construct(string $name, string $targetFragment, string $defaultOption = null)
No description
$this
addFilterOption(string $name, string $title, callable|array $filter)
Add an option to the dropdown that provides a filter
$this
removeFilterOption(string $name)
Remove a filter option with the given name
array
getActions($gridField)
Return a list of the actions handled by this action provider.
Used to identify the action later on through the $actionName parameter in handleAction.
There is no namespacing on these actions, so you need to ensure that they don't conflict with other components.
handleAction(GridField $gridField, $actionName, $arguments, $data)
Handle an action on the given GridField.
Calls ALL components for every action handled, so the component needs to ensure it only accepts actions it is actually supposed to handle.
DataList
getManipulatedData(GridField $gridField, SS_List $dataList)
Manipulate the DataList as needed by this grid modifier.
array
getHTMLFragments($gridField)
Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
Here are 4 built-in fragments: 'header', 'footer', 'before', and 'after', but components may also specify fragments of their own.
To specify a new fragment, specify a new fragment by including the text "$DefineFragment(fragmentname)" in the HTML that you return.
Fragment names should only contain alphanumerics, -, and _.
If you attempt to return HTML for a fragment that doesn't exist, an exception will be thrown when the GridField is rendered.