views:

20

answers:

1
  1. How do I set up YUI treeview so that all nodes are in collapsed state initially?
  2. Is it possible to set up YUI treeview so that it is collapsed if no nodes are selected, but expanded if nodes are selected (only the branch with nodes selected are expanded)? If so, how?

Thanks.

+1  A: 

Yui treeview should be collapsed by default If you are using a config object to define it, ensure that you dont have: expanded: true in there

See the examples here: http://developer.yahoo.com/yui/examples/treeview/tv_markup.html and note that where you see either expanded:true or class="expanded" you want expanded:false or no class set.

unomi