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
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!