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

Scroll selected node into viewport?

1 Answer 161 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 30 May 2014, 03:51 PM
I'm selecting a node on a TreeView programmatically. How would I expand all parent nodes and scroll the node into the viewport? Thanks!

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 03 Jun 2014, 07:28 AM
Hello Jonathan,

You can use the expandPath TreeView method to expand a list of nodes. Here is a demo:

http://jsbin.com/fufofucacoqu/1/edit

For older Kendo UI TreeView versions, which do not have an expandPath method, one can use some custom code:

http://jsbin.com/ESOjAmi/8/edit

In order to scroll a node in the viewport, you can use either the scrollIntoView method, or if you want to have more control over the transition, the scrollTo jQuery plug-in.

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
TreeView
Asked by
Jon
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or