This is a migrated thread and some comments may be shown as answers.

How to filter treeview which is loaded lazily and with remote data

3 Answers 309 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Naga
Top achievements
Rank 1
Naga asked on 05 May 2017, 01:12 AM

Hi 

I have a treeview with remote binding like this

http://demos.telerik.com/kendo-ui/treeview/remote-data-binding

how to filter data when data is bound remotely? 

in this example i want to give "Robert King" as input and want to open all nodes until "Robert King"

 

2. ) If i provide input "Laura Callahan" is there a way i can stop opening "Steven Buchanan" node ? 

i am getting haschildren value from my database, if hasChildren is false i should not open that node

Please help with above two tasks.

 

Thanks

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 08 May 2017, 10:27 AM
Hello,

You can filter the nodes that are already loaded as for example it is done in the code in this dojo page. The nodes that are not loaded yet are not considered for the loading. If you want to consider them too you will have to implement custom filtering on the server side and recreate the widget after each serve request so that all the parent -child relationships are correct.

That is why in such filtering case we would rather recommend setting loadOnDemand to false.

Regards,
Plamen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Boris
Top achievements
Rank 1
answered on 28 May 2019, 12:13 PM
I have a similar constellation. A remote data source with loadOnDemand set to true hooked up to a checkboxed dropDownTree. I want the user to be able to use the widgets search function and set the filter setting to "contains", but only the already loaded elements will be used in the search. Is there a way to load all the remaining elements as soon as the user enters something in the widgets searchbox?

Thanks in advance
0
Plamen
Telerik team
answered on 30 May 2019, 01:32 PM
Hi,

There is no built in way to load all the nodes. One possible option is to use the dataBound event and loop through the loaded items and trigger reed on the items that have children yet in such cases we would rather recommend using loadOnDemand false.

Regards,
Plamen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeView
Asked by
Naga
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Boris
Top achievements
Rank 1
Share this question
or