column sort issue for treegrid

I am using the dhtmlXTreeGrid 1.4 professional version and has an issue for the column sorting. here are my code snippet:

    mygrid = new dhtmlXGridObject(‘entityJurBox’);

    mygrid.selMultiRows = true;

    mygrid.imgURL = “/ams/resources/img/dhtmlxTreeGrid/”;

mygrid.setHeader(“Jurisdiction,Filing,Nexus,Nexus Flow,PL 86-272,Rule,Apportionment,Rate”); // header names

mygrid.setInitWidths(“150,100,100,100,100,100,100,100”); // initial header widths







mygrid.attachEvent(“onEditCell”,function(stage, row, col){

if (col==2 || col==4 || col==5)

return true;

return false;






As you may be aware, I have a servlet which generates the XML data for tree grid to render. The treegrid displays data as expected. However, when I click the column header 9any header) to sort, I got the javascript error said “Line: 2130 Error: ‘_childIndexes’ is null or not an object”. When I set the alert in the line 2130, dhtmlXGrid.js, I found that row_id=undefined, which cause the above error.

If I create an XML file contains the same data, the column sort is working. So what did I miss?

Here are the data I try to render.

<?xml version="1.0" encoding="UTF-8"?>


        New York








            New York City














The code which you are provided works fine with static XML, so most probably error somewhere in your servlet which generates XML
Similar problem can occur if you data XML contains empty or not-unique IDs of rows ( in such case grid may render correctly, but any row related action will cause such error )

Please be sure that each row in generated XML contains unique ID , to check data fetched from your servlet you can use attached file instead of default dhtmlxcommon.js♠ (5.82 KB)