0

My application has tree view in left side of page. when any node is selected in the tree, the information about the page displays in the detail side of the page which is the right side.

Now I have search component at top of page, in which I can search for specific node in tree. When the result is found, the result node is selected.

But the the result node is not in the current view, I want the tree component to be scrolled down to the selected node. Any help on how this can be done would be really helpful.

Pratik Nelge
  • 386
  • 3
  • 21

2 Answers2

1

I think we can directly use, the builtin scrollIntoView function to autoscroll here

Vamsi
  • 71
  • 2
  • 6
0

You can achieve this by using scrollTo function of jquery.

$('body').scrollTo('#target');

You can also find helpful alternatives in this post scroll element

Naseer
  • 174
  • 1
  • 8