hummingbird-dev / hummingbird-treeview

A powerful and fast jQuery treeview plugin
MIT License
62 stars 23 forks source link

initialize expand tree #6

Open CharleysTante opened 6 years ago

CharleysTante commented 6 years ago

First thanks for your great script :-) But if I want to initialize a pseudo HTML with "expandAll", it dosen't work in the right way. I'll get a tree but it is not possible to collapse or expand it via mouse click. Also the checkboxes doesn't work in this case for sub checknoxes, independently which browser I use.

The only workaround I found was, first to initialize the tree without any parameter and after that to use "expandAll", but I think that's not the best way ;-)

$("#treeview").hummingbird(); $("#treeview").hummingbird("expandAll");

hummingbird-dev commented 6 years ago

Hi, Thanks for using the hummingbird-treeview. You are absolutely right, initialization with "expandAll" is not possible and your workaround is a solution. However, there is a better way to do it via an option. Before initialization ($("#treeview").hummingbird();) use this: $.fn.hummingbird.defaults.collapseAll= false; Check the README for more options: https://github.com/hummingbird-dev/hummingbird-treeview#options