This sample demonstrates the Grid's default filtering feature. Type a value in the filterbar and press enter to filter a particular column.
Category Name | Product Name | Units In Stock | Discontinued |
---|---|---|---|
Beverages | Chai | 39 | |
Beverages | Chang | 17 | |
Beverages | Aniseed Syrup | 13 | |
Beverages | Chef Anton's Cajun Seasoning | 53 | |
Beverages | Chef Anton's Gumbo Mix | 0 | |
Beverages | Grandma's Boysenberry Spread | 120 | |
Beverages | Uncle Bob's Organic Dried Pears | 15 | |
Beverages | Northwoods Cranberry Sauce | 6 | |
Beverages | Mishi Kobe Niku | 29 | |
Beverages | Ikura | 31 |
The filtering feature enables the user to view a reduced amount of records based on filter criteria. It can be enabled by setting the allowFiltering
property to true. A filter bar row will be rendered next to header which allows users to filter data by entering text within its cells.
The Filterbar uses two modes which specifies how to start filtering. They are,
onenter
- Enabled by default, filter will be initiated when the Enter
key is pressed.immediate
- Filter will start after user finishes typing. There will be a time delay of 1500ms to initiate filter after the user stops typing. It can be overridden using the filterSettings->immediateModeDelay
property.In this demo, you can either select the Category Name from the SELECT element or type the text in the filter bar cells to filter.
Additionally, the records can also be filtered based on the selected filterbar operator. It can be enabled by setting filterSettings->showFilterBarOperator
property to true.
In this demo,
For example, when the Like search operator is used:
For example when the Wildcard search operator is used:
Injecting Module:
Grid features are segregated into individual feature-wise modules. To use filtering feature, inject the FilterService
using the @NgModule.providers
section.
More information on the filter configuration can be found in this documentation section.