This sample demonstrates the Tree Grid searching feature. In this sample, use the search box from toolbar to search Tree Grid records and the hierarchy mode of searching can be changed using property panel.
The Tree Grid has an option to search its content using the search method with search key as the parameter.
The tree grid supports different types of search mode through the searchSettings.hierarchyMode property
.
The following are the types of search modes available in the tree grid.
Parent
- This is the default search hierarchy mode in the tree grid. It displays a searched record with
its parent records. If the searched records do not have any parent record, it displays only the searched record.Child
- Displays the searched record with its child record.
If the searched records do not have any child record, it displays only the searched record.Both
- Displays the searched record with both its parent and child records.
If the searched records do not have any parent and child records, it displays only the searched record.None
- Displays only the searched record.In this demo, The Tree Grid toolbar provides an option to search the Tree Grid's records. The user can type the text box in the toolbar and click search button or press Enter key to perform search operation.And also we have an option to change the searching hierarchy mode through the dropdown.
Injecting Module:
Tree Grid features are segregated into individual feature-wise modules. To use searching feature, we need to inject Filter
module into the services
.
More information on the searching configuration can be found in this documentation section.