3.2.0

Manual tree scrolling

Alex,

I have implemented a wrapper class for your version 2 tree control that does all selections via an AJAX post to the server. It cancels all client actions and only makes selections via the server initiated callback methods. Depending upon configuration this could be multi-select or single select.

I have two problems.
1) When adding a new node to the bottom of the tree and selecting it, the scroll position does not change to show the newly selected item.

2) When I select an existing item in the middle of the tree, the scroll bar moves so that the item selected via the server is now the last item visible.

Questions:
1) How i can manually change the scroll to the bottom?
2) How can I ensure there is no scroll bar movement?

Thanks
Matt
February 28,
To scroll the tree content you have to use DOM scrollTop attribute -

tree.getContent("box").element().scrollTop = 50;

The current tree item receives keyboard focus. Then the element which has keyboard focus will be scrolled into view automatically. The current item and selected items are not necessarily the same, so you can change scroll position by moving the current item (but not selected ones).

You can also listen to the DOM onscroll event and return scroll position back.
Alex (ActiveWidgets)
February 29,

This topic is archived.

See also:


Back to support forum