Expanding Treenodes dynamically on client side

S

Sunny

I need to be able to expand and collapse a tree using javascript to support
synchronizing two trees on the same page without doing a post. I'm having
several problems, so can anyone tell me how to:
- reference a node properly from javascript. I do something like
tree2.getTreeNode(index) but the Expanded attribute in the object returned
is undefined. I can see that, in the treeview.htc file, the getTreeNode
method grabs a node and then does some strange stuff to it, afterwhich all
the properties in the node are undefined. How do you get a node so that its
properties can be retrieved?
- once I set the Expanded attribute on a returned node (I tried changing the
..htc to just return the node right away, and the Expanded property returns
correct), how can you get the tree to reflect this change? i.e. after
setting tree2.getTreeNode(index).expanded = true, how can you get the tree
to reflect this immediately?

Thanks
 
S

sip

Ok I found the solution to problem. The method actually returns a generic
object and you have to access the properties with getAttribute/setAttribute.
Changing the property through this setter also seems to update the tree
immediately.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top