Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
SingleBranchExpand and node.scrollIntoView
posted

Hi,

I'm experiencing a problem with the treeview having SingleBranchExpand set to true. The treeview is filled with lots of items on one level. Example:

  • chapter 1
    • paragraph 1
    • paragraph 2
    • paragraph 3
    • paragraph 4
    • paragraph 5
    • paragraph 6
    • ...
    • paragraph 50
  • chapter 2
    • paragraph 1
    • paragraph 2
    • paragraph 3
    • paragraph 4
    • paragraph 5
    • paragraph 6
    • ...
    • paragraph 50

The div the treeview is in uses scrollbars. Now when I select eg. 'chapter 1 - paragraph 6', everything is ok. But now when i select ' chapter 2', 'chapter 1' is collapsed and 'chapter 2' is expanded. The problem now is that the selection of 'chapter 2' is not visible for the user. He has to use the vertical scrollbar to make 'chapter 2' visible for him. I tried to set the node.scrollIntoView function in javascript, but this does not seem to work when having SingleBranchExpand set to true. Is there a solution for this?