The jQuery Treeview Plugin adds Collapse All, Expand All and Toggle All links to the “treeviewcontrol” div when the control property is defined as follows:
$("#black, #gray").treeview({
control: "#treecontrol",
persist: "cookie",
cookieId: "treeview-black"
});
This works great, but I’d like the ability to expand and collapse the treeview from other page elements outside of the treeview itself. I’ve looked at the source, but I can’t figure it out.
If you check out the demo page here you can see there is a div#treecontrol, well just make it a
treecontrolclass:Then you can make as many copies of this control and put them anywhere you want. Don’t forget to modify the control parameter: