loadOnDemand: true, Kendo tree view is not working

1 Answer 114 Views
TreeView
sai
Top achievements
Rank 1
Iron
sai asked on 24 Aug 2022, 12:01 PM
loadOnDemand: true, Kendo tree view is not working after upgrading kendo and jquery version ,previously  we are fetching the chide node data of treeview ,  after expanding the node but it is not working now

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 29 Aug 2022, 09:16 AM

Hello, Sai,

Could you reproduce the issue in this Dojo example by changing the jQuery and Kendo version you are using?

Regards,
Martin
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


sai
Top achievements
Rank 1
Iron
commented on 29 Aug 2022, 12:21 PM

Hi Martin,

 

Thank you for the response, actually we have and object which we set to kendo treeview datasource. but the thing is we are loading the child elements after expending the  parent element and then appeneding those child to the current expanded node. like below.

treeview.append(data, $(treeview.findByText(expandedNodeText))); 

in the expandedNodeText  variable we have parent node text , but when the control comes to this line it is throwing an error 

Uncaught TypeError: e.slice is not a function.

sai
Top achievements
Rank 1
Iron
commented on 30 Aug 2022, 04:46 AM

Hai martin,

Can u please find the attached file which has sample code.

Martin
Telerik team
commented on 01 Sep 2022, 10:53 AM

Please try specifying the children field in the model and use the setDataSource method. Here is the modified example.
sai
Top achievements
Rank 1
Iron
commented on 15 Sep 2022, 12:38 PM

Thank you martin it help as lot.. Thank you for your support..

We have one more issue related this tree view we are appending the data to the treeview component but the issue is before appending we are setting the data source to empty.

like below:

treeview1.setDataSource(new kendo.data.HierarchicalDataSource({
                            data: [],
                            schema: {
                                model: {
                                  hasChildren: true,
                                  children:"items"
                                }
                              }
                            }));

but here the issue is we want to set the hasChildren attribute dynamically. after seting the data to empty array.

Martin
Telerik team
commented on 20 Sep 2022, 09:01 AM

I am not sure there is a possible way to dynamically add the field. Maybe creating a new HierarchicalDataSource would be more appropriate.
Tags
TreeView
Asked by
sai
Top achievements
Rank 1
Iron
Answers by
Martin
Telerik team
Share this question
or