Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by pyt on Jan 14, 2009 10:52
open dhtmlx forum
TreeGrid

Hi,
i'm trying to use treegrid for the first time. I use the following codes:

in js:

<link rel="STYLESHEET" type="text/css" href="codebase/dhtmlxgrid.css">
<script src="codebase/dhtmlxcommon.js"></script>
<script src="codebase/dhtmlxgrid.js"></script>
<script src="codebase/dhtmlxtreegrid.js"></script>
<script src="codebase/dhtmlxgridcell.js"></script>

<script>
var mygrid;
function doInitGrid(){

mygrid= new dhtmlXGridObject("mygrid_container");

    mygrid.selMultiRows = true;

mygrid.setImagePath("/codebase/imgs/icons_greenfolders/");

mygrid.setHeader("Header1,Header2,Header3,Header4");

mygrid.setInitWidths("*,*,*,*");

mygrid.setColAlign("left,right,right,right");

mygrid.setColTypes("tree,ro,ro,ro");

mygrid.init();

mygrid.loadXMLString("treegrid.xml");

}

</script>
...

and treegrid.xml :

<?xml version="1.0" encoding="UTF-8" ?>
<rows parent="0">
<row id="1">
<cell>data</cell><cell>data</cell><cell>data</cell><cell>data</cell>
<row id="2">
<cell>data</cell><cell>data</cell><cell>data</cell><cell>data</cell>
</row>
<row id="3">
<cell>data</cell> <cell>data</cell><cell>data</cell><cell>data</cell>
</row>
</row>
</rows>

It shows only header line and i have this error:

eXcell is not defined /dhtmlxtreegrid.js(Line 30)

Can you help me?

Thanks in advance!
pyt

Answer posted by Support on Jan 15, 2009 02:04
a) Change the order of js files as

<script src="codebase/dhtmlxcommon.js"></script>
<script src="codebase/dhtmlxgrid.js"></script>
<script src="codebase/dhtmlxgridcell.js"></script>
<script src="codebase/dhtmlxtreegrid.js"></script> 

b) if you are loading data from external file, instead of mygrid.loadXMLString("treegrid.xml");  you need to use mygrid.loadXML("treegrid.xml"); 



Answer posted on Jan 15, 2009 13:11
now i have no error more, but i can see only the first row without "plus" icon and subrows.
Thank you for your help.
pyt

Answer posted by Support on Jan 16, 2009 03:45
Be sure that path to image folder is correct