Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Mike on Feb 04, 2009 12:48
open dhtmlx forum
this.obj.firstChild is null when loading grid structure from xml

I am using a grid in my application. Initially I was creating the grid and structure using the method calls (e.g. setInitWidths, setColAlign, etc)

When I switch this to use an XML structure the data does not load and I get the error message

this.obj.firstChild is null in dhtmlxgrid.js line 777

if (_isKHTML)this.obj.appendChild(r);else {this.obj.firstChild.appendChild(r)}else {this.rowsCol[ind].parentNode.insertBefore(r, this.rowsCol[ind])};this.rowsCol._dhx_insertAt(ind, r);return r},

I have not loaded any data into this particular grid yet, so I am not sure why this message comes up (I have 5 grids in my app and they were all working before I prior to my switching to xml files)

<?xml version="1.0" ?>
<rows>
<head>
<column type="ro" width="50" sort="int" align="center">Row #</column>
<column type="ro" width="60" sort="na" align="center">Links</column>
<column type="ro" width="100" sort="str" align="center">Document ID</column>
<column type="ro" width="75" sort="str" align="center">Collection Name</column>
<column type="ro" width="90" sort="str" align="left">Geo Ref</column>
<column type="ro" width="75" sort="str" align="center">Load Date</column>
<column type="ro" width="80" sort="int" align="center">Confidence</column>
<column type="ro" width="80" sort="int" align="center">Country Confidence</column>
<column type="ro" width="75" sort="int" align="center">Latitude</column>
<column type="ro" width="75" sort="int" align="center">Longitude</column>
<column type="ro" width="630" sort="str" align="left">Snippet</column>

    <beforeInit>
        <call command="setSkin">
            <param>modern</param>
        </call>
        <call command="enableMultiselect">
            <param>false</param>
        </call>
        <call command="setImagePath">
            <param>js/grid/imgs/</param>
        </call>
    </beforeInit>
</head>
</rows>

Answer posted by Support on Feb 05, 2009 07:43
The same XML works correctly in local samples ( attached )
The error similar to one in your case, can occur if you calling some data manipulation methods without creating grid's structure ( be sure that previously used XML, without head section, not cached )


Attachments (1)