Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Debamita on Dec 24, 2008 05:04
open dhtmlx forum
TreeGrid

http://dhtmlx.com/docs/products/kb/index.shtml?s=normal&q=7096&a=10866

Can you tell me what is wrong with this code that it is not displaying the plus sign if there is only one parent node?

Below is the code that i have used to construct the tree

XML string used is <?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<rows parent=\"a\">
 <row id=\"1\">
     <cell><![CDATA[0000 - ABC]]></cell><cell><![CDATA[30]]></cell><cell><![CDATA[32]]></cell><cell><![CDATA[$24,962.62]]></cell>
    <row id=\"2\">
    <cell><![CDATA[13200]]></cell><cell><![CDATA[3]]></cell><cell><![CDATA[3]]></cell><cell><![CDATA[$720.45]]></cell>
     </row>
     <row id=\"3\">
       <cell><![CDATA[71000]]></cell> <cell><![CDATA[2]]></cell><cell><![CDATA[2]]></cell><cell><![CDATA[$600.00]]></cell>
     </row>
 </row>
</rows>

and the javascript code is

function doMTDTreeGrid(){

        mtdTreeGrid = new dhtmlXGridObject("treeGrid");

                  mtdTreeGrid.selMultiRows = true;

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

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

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

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

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

                  mtdTreeGrid.enableTreeCellEdit(false);

                  mtdTreeGrid.setSkin("light");

                  mtdTreeGrid.enableTreeGridLines();

                  mtdTreeGrid.init();

                  mtdTreeGrid.loadXMLString(mtdXml);

      }

 

 

Answer posted by Support on Dec 24, 2008 05:28
XML , which you are using is incorrect, it must have next top element
<rows parent="0">
 <row id="1">

In current xml you are reffering for some unkwnow element "a"

Except of that - all other works correctly
Sample sent by email. ( if issue still occurs for you - please check that you have such image as /codebase/imgs/icons_greenfolders/plus1.gif