DHTMLX Docs & Samples Explorer

Lists of check boxes states

The following methods allow you to get lists reflecting the check boxes states (checked, unchecked, partially checked), moreover you can get a list of checked branches (some sub-items are checked).



Get list of checked

Get list of unchecked

Get list of partially checked

Get list of checked branches



Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtree.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxtree.js"></script>
 
<table>
    <tr>
        <td valign="top">
            <div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;"></div>
        </td>
        <td style="padding-left:25" valign="top">
        <br>
        <br>
        <a href="javascript:void(0);" onClick="alert(tree.getAllChecked());">Get list of checked</a><br><br>
        <a href="javascript:void(0);" onClick="alert(tree.getAllUnchecked());">Get list of unchecked</a><br><br>
        <a href="javascript:void(0);" onClick="alert(tree.getAllPartiallyChecked());">Get list of partially checked</a><br><br>
        <a href="javascript:void(0);" onClick="alert(tree.getAllCheckedBranches());">Get list of checked branches</a><br><br>
        </td>
    </tr>
</table>
<script>
tree = new dhtmlXTreeObject("treeboxbox_tree", "100%", "100%", 0);
tree.setSkin('dhx_skyblue');
tree.setImagePath("../../codebase/imgs/csh_bluebooks/");
tree.enableCheckBoxes(1);
tree.enableThreeStateCheckboxes(true);
tree.enableSmartXMLParsing(true);
tree.loadXML("../common/tree_cl.xml");
</script> <br><br>