New to Kendo UI for jQuery? Download free 30-day trial

Scroll to the Selected TreeView Item


Product Progress® Kendo UI® TreeView for jQuery
Operating System Windows 10 64bit
Visual Studio Version Visual Studio 2017
Preferred Language JavaScript


How can I scroll the viewport to the selected node of the Kendo UI for jQuery TreeView?


The following example demonstrates how to achieve the desired scenario.

    <div id="tree"></div>

      // Set up: generate the data, select an item.
      var data = [];
      for (var i = 0; i < 1000; i++) {
        data.push({ text: "Item " + i });
        dataSource: data
      var treeview = $("#tree").data("kendoTreeView");"Item 500"));

      // Scroll to the selected item.
      var itemScrollTop =[0].offsetTop;
      $("html,body").animate({ scrollTop: itemScrollTop });

See Also

In this article