Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Apostolis on Sep 26, 2007 16:13
open dhtmlx forum
Select / Deselect all nodes

Hello.

I have an object of dhtmlXTreeObject and I added some items using insertNewItem function. Each item in the tree is a checkbox.

Is there an efficient way to select and deselect all items of the tree, using a button/link/etc??

Thank you very much!
Answer posted on Sep 26, 2007 18:45
To unselect all items
    tree.clearSelection();

There is no built in functionality to select all items, but you can use next code snippet

    tree.clearSelection();
    for (var id in tree._idpull)
       if (typeof(val)=="object")
          tree.selectItem(id,true,true);