dhtmlxtree

I want to perform a selection of all elements in the tree hierarchy. When the user clicks on a link say’Select All’ …i wud direct to a javascript function say selectAll where I wud do

channelDhtmlxTree.setCheck(channelDhtmlxTree.getSelectedItemById(), true)

However, I don’t see the checkboxez being checked upon clicking on the link!

However, if I select one of the elements, only that element is getting checked after I click on ‘Select All’.



In short,Cud u pls help me in providing a way to select and deselect all items in the tree hierarchy?

The setCheck operation check only ONE item at once, in your scenario you must use something similar to next
    var ids=channelDhtmlxTree.getSelectedItemById().split(",")
    for (var i=0; i<ids.length; ids++)
        channelDhtmlxTree.setCheck(ids[i], true);