Constructor
new FilterClearButton(filterTreeType, clearType)
Creates new FilterClearButton
Parameters:
Name | Type | Description |
---|---|---|
filterTreeType |
FilterTreeEnum | 'vertical' or 'horizontal' |
clearType |
ClearType | clear type 'clear-single-value', 'clear-option-values', 'clear-all' |
Members
(static) ClearType
Get the clear button types enum
Methods
getTemplate() → {string}
Get the clear button's html template.
Depending on its clearType, it returns different templates
Returns:
Raw html template
- Type
- string
isVisible() → {boolean}
Check if the clear button is visible.
For example, if there are no selected filter items,
clear all button won't be visible.
Returns:
- Type
- boolean
onClearAll()
Clear all values of the filter
This button is a child of a FilterTree component
Calls API.
onClearOptionValues()
Clear all values of one filter options
This button is a child of a FilterOption component
FilterOption component has filterOptionId field, to know which values to clear.
Calls API.
onClearSingleValue()
Clears single filter value
This clear button is a child of the RefineByItem component,
RefineByItem component has filterOptionId and filterItemId fields, to know which value to clear.
Calls API
onClick(event)
On click the clear button
calls onClearSingleValue, or onClearOptionValues, or onClearAll depending on clear type
Parameters:
Name | Type | Description |
---|---|---|
event |
onDeselectOptionValues()
Deselects all filter option item in a filter option
Don't call API.