Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by jhoni on Mar 18, 2008 22:21
open dhtmlx forum
cannot set grid on split mode

i get error "this.hdr.rows.1._childIndexes is null or not an object"
when set grid on split mode.
how to repaired it ???

---------------------------------------------------------------------------
<script src="../../codebase/ext/dhtmlxgrid_splt.js"></script>
<script>
mygrid = new dhtmlXGridObject('gridbox');
...
mygrid.init();
mygrid.splitAt(1);
mygrid.loadXML("grid.xml");
</script>

list code of grid.xml
======================================
<?xml version="1.0" encoding="iso-8859-1" ?>
<rows id="0">
<head>
<column width="40" type="cntr" align="right" color="white" sort="na">No.</column>
<column width="40" type="ch" align="left" color="#D6D6D6" sort="na">QRY</column>
<column width="40" type="ch" align="left" color="#D6D6D6" sort="na">INST</column>
</head>
<row id="1">
<cell>
<![CDATA[1]]>
</cell>
<cell>
<![CDATA['ok']]>
</cell>
<cell>
<![CDATA['ya']]>
</cell>
</row>
<row id="2">
<cell>
<![CDATA[2]]>
</cell>
<cell>
<![CDATA['no']]>
</cell>
<cell>
<![CDATA['tdk']]>
</cell>
</row>
............................
</rows>
======================================


Answer posted by Support on Mar 19, 2008 03:05
splitAt need to be executed after data structure of grid already defined, so when you configuring grid from XML, splitAt need to be executed from XML as well.


mygrid.init();
//mygrid.splitAt(1);  - not  needed here
mygrid.loadXML("grid.xml");

list code of grid.xml
======================================
<?xml version="1.0" encoding="iso-8859-1" ?>
<rows id="0">
<head>
<column width="40" type="cntr" align="right" color="white" sort="na">No.</column>
<column width="40" type="ch" align="left" color="#D6D6D6" sort="na">QRY</column>
<column width="40" type="ch" align="left" color="#D6D6D6" sort="na">INST</column>
    <afterInit>
        <command call="splitAt"><param>1</param></command>
    </afterInit>
</head>
Answer posted by jhoni on Mar 19, 2008 04:11
ok, thanx. well done.