Angular TreeList Manual Filtering
The manual filtering gives the developer full control over the filtering of the data. Compared to the filtering with the built-in directive, the manual approach provides greater transparency of the filtering process because it requires you to handle the TreeList events manually. The manual filtering is especially useful when you require additional customization of the filtering logic.
To implement manual filtering:
- Set the
filterable
option. - Bind the
filter
option to aCompositeFilterDescriptor
object. - To filter local data or send a remote service request, handle either of the following events:
filterChange
event—use it when only filtering is enabled.dataStateChange
event—use it when more than one data operation is enabled. Check theData Operations
article for more details on how to handle multiple data operations.
Filtering Local Data
To filter the data, use the built-in filterBy()
or process()
functions.
When you enable multiple data operations, handle the
dataStateChange
event instead of thefilterChange
event. Further details on how to manually process the data with multiple data operations enabled are available in the section on handling multiple data operations.
The following example demonstrates this approach.
Server-Side Filtering
Handle the filterChange
or dataStateChange
event to send a request containing information about the current TreeList state to the server.