fperucic / treant-js

Treant.js - javascript library for drawing tree diagrams
MIT License
864 stars 314 forks source link

I want to programmatically collapse and expand the entire tree, by clicking a button #139

Open jerinamathews opened 5 years ago

jerinamathews commented 5 years ago

I want to expand and collapse entire tree by clicking a button. How will i do that in js?

losewin commented 4 years ago

You just have to set the collapsed: true then the rest is false

yinxs commented 4 years ago

I've been trying to do the same on subtrees. Give people the option to expand an entire part of the tree if they want to, while initially it's all collapsed. I was hoping I could achieve it by calling a click event on all collapse-switch items within, but the click event doesn't register.

losewin commented 4 years ago

Sorry to tell, but can you provide some code to test with the moderators on this plugin?