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

Expand to specific item

1 Answer 175 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 13 Jan 2015, 01:13 PM
How can I expand to a specific item?
I use a treelist with remote datasource. I start non-expanded but after first load I'd like to expand all rows until a specific item and sedlect this item.

Thank you!

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 15 Jan 2015, 09:40 AM

Hello Roger,

There is no out of the box method to achieve this. In order to expand all levels up to a given node, you need to know the IDs of all of its parents (the so-called path).

If you know the path on the server-side, it is most efficient to set the expanded flag of all nodes along the path when you serialize them from the server, and serialize their sibling nodes as well.

If you expand the items on the client-side, you will need to make one request for each parent along the path. You can achieve this by calling the expand method in the dataBound event, making one step on the path each time.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeList
Asked by
Roger
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or