Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by haritha on Oct 01, 2008 01:03
open dhtmlx forum
Checkbox in dhtmltree


Hi,

I am using the following code to display tree with checkboxes...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Tree.html</title>
    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">

<link rel="stylesheet" type="text/css" href='codebase/dhtmlxtree.css'>
<script src='codebase/dhtmlxcommon.js'></script>
<script src='codebase/dhtmlxtree.js'></script>        
<script src='codebase/ext/dhtmlxtree_start.js'></script>        
</head>

<body>
<div

id="treeboxbox_tree"
setImagePath="codebase/imgs/csh_bluebooks/"
style="width:250px; height:218px;overflow:auto;">

<ul>
<li>Root</li>
<ul>
<li>Child1
<ul>
<li>Child 1-1</li>
</ul>
</li>
<li>Child2</li>
<li><b>Bold</b> <i>Italic</i></li>
</ul>
</ul>
</div>

<script>
var myTree = dhtmlXTreeFromHTML('treeboxbox_tree');

myTree.enableCheckBoxes(1);

</script>
</body>
</html>

but i am getting the checkboxes... please help me out

Thanks
haritha
Answer posted by Support on Oct 01, 2008 02:14
The enableCheckBoxes command need to be executed before loading data in tree. In your case it can be done as

<div id="treeboxbox_tree"  setImagePath="codebase/imgs/csh_bluebooks/"  style="width:250px; height:218px;overflow:auto;" enableCheckBoxes="true">

...

<script> 
var myTree = dhtmlXTreeFromHTML('treeboxbox_tree'); 
</script>