Hi,
I have a problem with rendering of treelines when I’m loading my data dynamically.
The problem is that on the last leaf in the tree, the line is still drawn vertical instead of like an ‘L’ to end the lines.
I have the following setup:
[code] $addHandler(window, ‘load’, function() {
var mygrid = new dhtmlXGridObject(‘divPUTavla’);
mygrid.selMultiRows = true;
mygrid.imgURL = “dhtmlx/dhtmlxGrid/codebase/imgs/icons_greenfolders/”;
mygrid.setHeader(“Åtgärd,Kostn.st.,Konto, ,2010,#cspan,2011,#cspan,2012,#cspan,2013,#cspan,2014,#cspan,2015,#cspan”);
mygrid.attachHeader(“#rspan,#rspan,#rspan,#rspan,#rspan,Planerat,Utfall,Planerat,Utfall,Planerat,Utfall,Planerat,Utfall,Planerat,Utfall,Planerat,Utfall”);
mygrid.setInitWidths(“350,80,80,20,50,50,50,50,50,50,50,50,50,50,50,50”);
mygrid.setColTypes(“tree,ro,ro,ch,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed”);
mygrid.attachFooter([“Total (drift)”, “#cspan”, “#cspan”, “#cspan”, “0”, “0”, “120”, “154”, “22”, “0”, “0”, “0”, “0”, “0”, “0”, “0”], [“text-align: right;”]);
mygrid.attachFooter([“Total (investering)”, “#cspan”, “#cspan”, “#cspan”, “75”, “75”, “240”, “105”, “0”, “0”, “0”, “0”, “0”, “0”, “0”, “0”], [“text-align: right;”]);
mygrid.attachFooter([“Total”, “#cspan”, “#cspan”, “#cspan”, “75”, “75”, “360”, “259”, “22”, “0”, “0”, “0”, “0”, “0”, “0”, “0”], [“text-align: right; font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”, “font-weight: bold;”]);
mygrid.enableTreeCellEdit(false);
mygrid.enableTreeGridLines();
mygrid.init();
mygrid.setSkin(“dhx_skyblue”);
mygrid.splitAt(4);
mygrid.kidsXmlFile = 'dummy';
mygrid.attachEvent('onDynXLS', function(start, count) {
// Load data from server using AJAX-call that returns XML
var sXML = get_the_data_under_the_current_node(start);
mygrid.parse(sXML);
return false;
});
// Load top-level data from the server using AJAX-call that returns XML
var sXML = get_the_data();
mygrid.parse(sXML);
});
[/code]
The server-side method returns XML in the following format:
<?xml version="1.0" encoding="utf-8"?>
<rows>
<row id="abc" xmlkids="abc">
<cell>First item in tree</cell>
</row>
</rows>
<?xml version="1.0" encoding="utf-8"?>
<rows parent="abc">
<row id="def" xmlkids="def">
<cell>Sub-item</cell>
</row>
</rows>
<?xml version="1.0" encoding="utf-8"?>
<rows parent="def">
<row id="klm">
<cell>Leaf in tree with some values</cell>
<cell/>
<cell>1910</cell>
<cell>0</cell>
<cell>150000</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell>149000</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
</row>
</rows>
If I load all of the data at once using the following XML, the lines are drawn correctly:
<?xml version="1.0" encoding="utf-8"?>
<rows>
<row>
<cell>First item in tree</cell>
<row>
<cell>Sub-item</cell>
<row>
<cell>Leaf in tree with some values</cell>
<cell/>
<cell>1910</cell>
<cell>0</cell>
<cell>150000</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell>149000</cell>
</row>
</row>
</row>
</rows>
Am I doing something wrong, perhaps missing a setting, or have I stumbled across a bug?