Scroll selected node into viewport?

2 posts, 0 answers
  1. Jon
    Jon avatar
    14 posts
    Member since:
    Sep 2009

    Posted 30 May 2014 Link to this post

    I'm selecting a node on a TreeView programmatically. How would I expand all parent nodes and scroll the node into the viewport? Thanks!
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 03 Jun 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top