loading a tree with a preselected node

19 views
Skip to first unread message

httpwe...@gmail.com

unread,
Jul 15, 2009, 10:42:39 AM7/15/09
to mootree
I can't recall how to do this, or if it's possible.

I want to initialize a tree on the page (using adopt or load, I don't
care which), so when the tree renders it is already open to, and
preselected with, a certain node.

I tried something like this:

tree.root.load('/alltreenodes.php?preload='+nodeid); // this loads all
the nodes in the whole tree
tree.select(tree.get(nodeid));

in the second line, tree.get fails to find nodeid, presumably because
the load happens asynchronously and so the node I'm looking for hasn't
loaded yet.

I'm feeling stupid today, does anyone feel like helping with this one

Reply all
Reply to author
Forward
0 new messages