Completed
Last Updated: 10 Jun 2021 18:06 by ADMIN
ADMIN
Vera
Created on: 03 Aug 2012 03:09
Category: UI for ASP.NET AJAX
Type: Feature Request
1
Scroll into a specific node or item of the RadOrgChart on initial load of the page holding the control
A functionality that will enable users to scroll into a specific node or item of the RadOrgChart on initial load of the page holding the control
1 comment
ADMIN
Rumen
Posted on: 10 Jun 2021 18:06

Thank you for the feature request!

It can be achieved with a little bit of JavaScript and the scrollIntoView method:

<script type="text/javascript">
      function search() {
 
          var $ = $telerik.$,
              searchedName = $(".searchText")[0].value.trim().toLowerCase(),
              names = $(".rocItemText"),
              namesCount = names.length,
                  orgchart=$find("<%=RadOrgChart1.ClientID %>");
         
          for (var i = 0; i < namesCount; i++) {
              var currentName = names[i];
 
              if (currentName.innerHTML.trim().toLowerCase() == searchedName)
              {
                  currentName.scrollIntoView();
                 // var node = orgchart._extractNodeFromDomElement(currentName);
                 // orgchart.drillDownOnNode(node._getHierarchicalIndex());
                  break;
              }
          }
      }
  </script>