There are javascript methods to scroll to a given node in the DOM tree
if you need to scroll the whole document. If you are in an inner div
you will want to use scrollTop and scrollHeight to determine & set the
scroll position of the div. Just give an element in your node a static
ID (forceId from tomahawk) so that you can find it using javascript.

Just google the web on scrolling if you are not up to speed on these
javascript methods.

On 7/31/06, Adam <[EMAIL PROTECTED]> wrote:
Dear All,

we are happily using tree2 & the problem I have is to do with the scrolling.

Is there anyway to tell the scrooling mechanism to scroll to a given node?

i.e. we have a tree which is sufficiently large that it needs a scroll
bar etc. When we add a new node, it is added to the end of the tree in
some applications & in a sorted position in others (e.g. the nodes are
alphabetically sorted).his means that when a user clicks to add a new
node, he has to scroll down to the end of what might be a large tree
every time which can get to be a pain for those inserting data.

I add a node as follows:

                Node XPNode = deb.addChildN();
                String path = dtb.getpathToRoot(XPNode);
                dtb.tree.expandPath(dtb.tree.getPathInformation(path));

& the node happily expands etc but....that in no way interacts with the
scrolling. i..e the node is expanded but it's still off the page &
requires scrolling to get to it.

So how do I (can I?) set the focus to the node added as above such that
the scrolling mechanism takes the user to that node?

TIA


Adam


Reply via email to