Collaps or Expand TreeExpanderButton



How can i collaps or expand TreeExpanderButton
in javascripte code ?



Set (or bind) Node.isTreeExpanded. Or call Node.collapseTree or Node.expandTree.


Thank but my problem is:
I use the example of Double Tree
when I add the TreeExpanderButton button,
I lose the double tree ->


I just copied the DoubleTree.html sample and added:

      , $("TreeExpanderButton")

to the node template.

Although the nodes don’t look great, they operate well when I click on the "TreeExpanderButton"s.


TreeExpanderButtons Works
but i lost double tree layout
how to keep double tree layout ?


What do you mean? By default collapsing a subtree will remember the locations of the hidden nodes, and then expanding that subtree will restore those node locations.

If you want to do another layout, just call doubleTreeLayout.

Oh, maybe you are asking about how to call doubleTreeLayout whenever the user collapses or expands a subtree? Implement “TreeCollapsed” and/or “TreeExpanded” DiagramEvent listeners.

I hope you now see why it is that we have a minimum length for a new post – we want to encourage you to include enough information so that we can understand what the environment is for your question.