Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Pattakorn on Oct 07, 2009 02:03
open dhtmlx forum
Checked in Checkbox Not work

I writng program in JSP.

 

<script>

tree = new dhtmlXTreeObject("treeboxbox_tree", "100%", "100%", 0);
 
tree2.setSkin('dhx_skyblue');
tree2.setImagePath("../../codebase/imgs/csh_bluebooks/");
tree2.enableCheckBoxes(1);
tree2.enableThreeStateCheckboxes(true);
tree2.loadXML("../common/tree3.xml");

tree2.setCheck("rc",true);
</script>

when i try write this code dhtmlxTree show all checkboxes but it's not check in "rc",

can you show me any idea will be greatful ?

how to render dhtmlxTree with some of the checkboxes checked by default.

if you have some sample serializeTree() pls give me, Pattakorn E-Mail java_thai@windowslive.com

Thanks

Pattakorn

Answer posted by Stanislav (support) on Oct 07, 2009 02:23
The loading is async. In above code you are calling setCheck before data is really loaded in the tree. 
You need to change the code as


tree2.loadXML("../common/tree3.xml",function(){
       // executed after data loading
        tree2.setCheck("rc",true);
});