We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Filter TreeView like TreeGrid (hierarchyMode 'Both')

Hello,


I use the TreeView component and want to filter the nodes. 

There is an example in the docs that filter the nodes, but not deeper than the search hit.

What I want to do is the same like you provide in the TreeGrid with 

treeGrid.filterSettings.hierarchyMode = 'Both';

Have you any example for that? 

Would it be possible to have the same hierarchyMode API you provide in the TreeGrid in the TreeView component?


Thanks in advance

Sincerly

René


1 Reply

IL Indhumathy Loganathan Syncfusion Team October 18, 2022 08:45 AM

Hi René,


Greetings from Syncfusion support.


We understand that you want filtering support for TreeView with a hierarchical data source. Currently, DataManager only has support for filtering the first level of the tree nodes and doesn’t support filtering of hierarchical data sources. So this can be achieved only through datasource looping.


As requested, we have prepared an Angular TreeView sample to perform filtering on hierarchical data. We have rendered the filtered parent node with its corresponding child nodes. Please see the sample at the link below.


https://stackblitz.com/edit/angular-aqorek-dyz7mf?file=app.component.html,app.component.ts,package.json,app%2Fapp.module.ts


Please check the sample and get back to us if you need any further assistance.


Regards,

Indhumathy L


Loader.
Live Chat Icon For mobile
Up arrow icon