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

Kendo React TreeView Expand not Working

2 Answers 610 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jesil
Top achievements
Rank 2
Jesil asked on 03 Dec 2019, 04:29 AM

https://stackblitz.com/edit/kendotreeviewedit?file=index.js

 

i had a problem about expanding and collapsing the data on my treeview, am sharing my code with this discussion. The problem is i have child data in my treeview that not collapsing, only the parent data was working correctly. On that project Item2 is my parent data and item2.1 and item2.1.1 are my child data, that child data's expand are not working. how can i solve that issue

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 03 Dec 2019, 07:57 AM

Hello,

Thank you for your example.

After inspecting it I noticed that the expand all and collapse all buttons works as expected.

I saw that only the collapsing of child nodes is not working, but this is expected because indexOf is not working on tree structures and returns -1.

I can suggest using our helper functions as this will allow the method to automatically map the expanded and collapsed items:

https://www.telerik.com/kendo-react-ui/components/treeview/expansion/update-expanded-items/#toc-using-a-helper-function

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jesil
Top achievements
Rank 2
answered on 03 Dec 2019, 11:55 AM
Ok, thanks it's works
Tags
General Discussions
Asked by
Jesil
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Jesil
Top achievements
Rank 2
Share this question
or