FilterField
A simple text field for filtering a store.
Allows filtering by field:
const filterField = new FilterField({
store : eventStore,
field : 'name'
});
Or by using a filter function for greater control/custom logic:
const filterField = new FilterField({
store : eventStore,
filterFunction : (record, value) => record.name.includes(value)
});
Configs
115
Configs
115Common
Filtering
The model field name to filter by. Can optionally be replaced by filterFunction
Optional filter function to be called with record and value as parameters for store filtering.
{
type : 'filterfield',
store : myStore,
filterFunction : (record, value) => {
return record.text.includes(value);
}
}
| Parameter | Type | Description |
|---|---|---|
record | Model | Record for comparison |
value | String | Value to compare with |
Returns true if record matches comparison requirements
In case the filterId that is used in the store needs to be referenced elsewhere, it can be configured.
This applies to a passed filterFunction as well as for an internally generated filter.
If no value is configured, an internal ID will be generated.
{
type : 'filterfield',
store : myStore,
filterId : 'ColumnFilter'
}
Set this flag to mark the filter as internal when adding it to the associated Store.
This prevents the filter from being removed when Store.clearFilters()
is called.