Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dhanya on Jun 11, 2009 05:40
open dhtmlx forum
Selecting all the checkboxes inside the treenodes on a button click.

Hi,

I would like to know whether is it possible to select all the checkboxes with the tree.
I am using the below code now var rootsAr = tree.getSubItems(0).split(",")

for(var i=0;i<rootsAr.length;i++){
tree.openAllItems(rootsAr[i]);
//tree.setCheck(rootsAr[i],true)
tree.setSubChecked(rootsAr[i],true)
}
But only the checkboxes in the last node alone is showing as checked after the operation.
Please help me out.
Answer posted by Alex (support) on Jun 11, 2009 07:05

Hello, 

you have asked the same question by email. The reply is already sent. 

Answer posted on Jun 12, 2009 00:20
It is not working. Only the checkboxes in the first node alone is selected.
Answer posted by Alex (support) on Jun 12, 2009 02:39

We have tested the following approach - it works correctly:

...

tree.loadXML("xml.php",function(){
 tree.openAllItemsDynamic(0)  
});
tree.attachEvent("onAllOpenDynamic",function(){
 tree.setSubChecked(0,true)
})

Please, provide the dirrect link to the problematic page (you can send it to support@dhtmlx.com)