This section describes the different ways to apply column filters.
Apply, Clear, Reset and Cancel Buttons Copy LinkBy default, the four filters provided by the grid - Text Filter, Number Filter, Date Filter and Set Filter - support different action buttons. When enableFilterHandlers = true
, the Multi Filter and Custom Filter Components can also support action buttons.
The four supported action buttons are:
The buttons will be displayed in the order they are specified in the buttons
array of the filter params (FilterWrapperParams
).
If the filter is in a popup, it can be closed after using a button via closeOnApply
. Note the expected behaviour when clicking the filter popup buttons:
closeOnApply
set to true
.closeOnApply
set to true
and Apply button is present.closeOnApply
set to true
.The example below demonstrates using the different buttons. It also demonstrates the relationship between the buttons and filter events. Note the following:
closeOnApply
set to true
, so the filter popup will be closed immediately when the filter is applied or cancelled. Pressing âµ Enter will also apply the filter and close the popup.Note the following about filter events:
onFilterOpened
is called when the filter is opened.onFilterModified
is called when the filter changes regardless of whether the Apply button is present.onFilterChanged
is called only after a new filter is applied.getModel()
and getModelFromUi()
are different. The first reflects the active filter, while the second reflects what is in the UI (and not yet applied).Filters maintain a separate unapplied model representing what is shown in the UI, which might change without having yet been applied, for example when an Apply button is present and the user has made changes in the UI but not yet clicked Apply.
This happens for all grid provided filters, or when enableFilterHandlers = true
.
Calling api.getColumnFilterModel(column, true)
will always return a model representing the current UI, whereas api.getColumnFilterModel(column)
will return the applied model that is currently being used for filtering.
It is also possible to perform filter actions such as applying the model via the API doFilterAction(params)
.
Continue to the next section to learn about the Filter API.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4