Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Sanju Thomas on Jul 23, 2009 11:35
open dhtmlx forum
how do I avoide check boxes for child nodes ?

I have treegrid, where the first column is a check box and second column is a tree. I need check box only for the main nodes in the tree. I don't need it for child nodes. How do I do that ?

code I am using is given below. In this case I need check box only in the first row. I may have many parent nodes in the tree in real life.

code
-----

<link rel="STYLESHEET" type="text/css" href="js/dhtmlxTreePro/js/grid/dhtmlxgrid.css">

<script src="js/dhtmlxTreePro/js/dhtmlxcommon.js"></script>
<script src="js/dhtmlxTreePro/js/grid/dhtmlxgrid.js"></script>        
<script src="js/dhtmlxTreePro/js/grid/dhtmlxgridcell.js"></script>
<script src="js/dhtmlxTreePro/js/grid/dhtmlxtreegrid.js"></script>
<script src="js/dhtmlxTreePro/js/dhtmlxtree_er.js"></script>
<script src="js/dhtmlxTreePro/js/grid/dhtmlxtreegrid.js"></script>




    
<div id="mygrid_container" style="width:627px;height:300px;"></div>

<body onload="doInitGrid();">


<script>

var mygrid;

function doInitGrid(){

mygrid = new dhtmlXGridObject('mygrid_container');
mygrid.setImagePath("js/dhtmlxTreePro/imgs/");
mygrid.setHeader("S,Location,High,#cspan,#cspan,Medium,#cspan,#cspan,Low,#cspan,#cspan");
mygrid.attachHeader("#rspan,#rspan,Open,Closed,Other,Open,Closed,Other,Open,Closed,Other");
mygrid.setInitWidths("25,168,48,48,48,48,48,48,48,48,48");
mygrid.setColAlign("left,left,middle,middle,middle,middle,middle,middle,middle,middle,middle");
mygrid.setColTypes("ch,tree,er,er,er,er,er,er,er,er,er");
mygrid.setSkin("light");
mygrid.enableColSpan(true);
mygrid.setSkin("light");
mygrid.init();
mygrid.loadXML("1.xml");

}


</script>


xml
-----



<?xml version="1.0" encoding="UTF-8"?>
<rows><row id="Pending"><cell/><cell>Pending</cell><row id="Pre-FY 2008"><cell>Pre-FY

2008</cell><cell>0</cell><cell>9</cell><cell>0</cell><cell>3</cell><cell>26</cell><cell>0</cell><cell>0</cell><cell>25</cell><cell>0</cell></row><row id="FY

2009"><cell>FY

2009</cell><cell>0</cell><cell>3</cell><cell>0</cell><cell>2</cell><cell>0</cell><cell>0</cell><cell>0</cell><cell>1</cell><cell>0</cell></row><row id="FY

2008"><cell>FY 2008</cell><cell /><cell /><cell /><cell>4</cell><cell>7</cell><cell>0</cell><cell>0</cell><cell>3</cell><cell>0</cell></row><row id="Last 30

Days"><cell>Last 30 Days</cell><cell /><cell /><cell /><cell /><cell /><cell /><cell>1</cell><cell>0</cell><cell>0</cell></row></row></rows>
Answer posted by dhxSupport on Jul 24, 2009 01:34
You can set necessary type for the cells via xml:
mygrid.setColTypes("ro,tree,er,er,er,er,er,er,er,er,er");

xml 
-----
<rows><row id="Pending"><cell type="ch"></cell><cell>Pending</cell><row id="Pre-FY 2008">