Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Hans on Jan 20, 2009 05:16
open dhtmlx forum
getChangedRows() error on tree grid

Hi!

1. I delete the last row under a node in a treegrid.
2. After this when calling getChangedRows() I get this JavaScript error:

"..childNodes.length is null or not an object.."

The debugger shows:

function(id){var row = this.rowsAr[id];
var cols = row.childNodes.length;        (error here)
for (var j = 0;j < cols;j++)

Is there some known issues with getChangedRows in treegrid? Do you need more code?
In grid which is not tree, it works fine.

Cheers,

/Hans

Answer posted by dhxSupport on Jan 20, 2009 08:03
There is no known issues which may cause such problem.
Please be sure that
- you are using unique IDs for each row 
- you not using such ID as 0, false, null

If above rules fulfilled and error still occurs - please provide info, which version of dhtmlxTreeGrid you are using




Answer posted by Hans on Jan 20, 2009 15:30

Hi,

Actually as it turned out, deleting a row was not required to get the error. Calling getChangedRows anytime after init produces the same error.
I am using dhtmlxSuite_2008Rel3_pro_81009.

Here is the xml, please check if there are any errors in that.

Cheers,

/Hans

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

- <rows>
- <row id="20081217_145636_99892526" xA="itemmedia" open="1">
  <cell image="blank.gif">Line Item</cell>
  <cell>[ORDERNUMBER]_[SITE]_[PRODUCT]_[SIZE]</cell>
  <cell>CPM</cell>
  <cell>100000</cell>
  <cell>14/12/2008</cell>
  <cell>21/12/2008</cell>
  <cell>Running</cell>
  <cell>53500</cell>
- <row id="20090112_100020_91795000" xA="flight">
  <cell image="blank.gif">Flight</cell>
  <cell>[ORDERNUMBER]_[SITE]_[PRODUCT]_[SIZE]_1</cell>
  <cell>CPM</cell>
  <cell>80000</cell>
  <cell>14/12/2008</cell>
  <cell>21/12/2008</cell>
  <cell>Running</cell>
  <cell>21000</cell>
- <row id="20090112_152318_49417900" xA="creative">
  <cell image="blank.gif" />
  <cell colspan="5">[MEDIA]</cell>
  <cell />
  <cell />
  <cell />
  <cell />
  <cell />
- <cell type="ro">
<![CDATA[
 <button onClick="lDoAttach(this)" class="clButCreative">Creative..</button> 
  ]]>
  </cell>
  </row>
- <row id="20090112_152318_49417901" xA="creative">
  <cell image="blank.gif" />
  <cell colspan="5">[MEDIA]</cell>
  <cell />
  <cell />
  <cell />
  <cell />
  <cell />
- <cell type="ro">
<![CDATA[
 <button onClick="lDoAttach(this)" class="clButCreative">Creative..</button> 
  ]]>
  </cell>
  </row>
- <row id="20090112_152318_49417902" xA="creative">
  <cell image="blank.gif" />
  <cell colspan="5">[MEDIA]</cell>
  <cell />
  <cell />
  <cell />
  <cell />
  <cell />
- <cell type="ro">
<![CDATA[
 <button onClick="lDoAttach(this)" class="clButCreative">Creative..</button> 
  ]]>
  </cell>
  </row>
  </row>
+ <row id="20090112_100020_91795001" xA="flight">
  <cell image="blank.gif">Flight</cell>
  <cell>[ORDERNUMBER]_[SITE]_[PRODUCT]_[SIZE]_2</cell>
  <cell>CPM</cell>
  <cell>20000</cell>
  <cell>19/12/2008</cell>
  <cell>20/12/2008</cell>
  <cell>Running</cell>
  <cell>32500</cell>
- <row id="20090112_152318_49417903" xA="creative">
  <cell image="blank.gif" />
  <cell colspan="5">[MEDIA]</cell>
  <cell />
  <cell />
  <cell />
  <cell />
  <cell />
+ <cell type="ro">
<![CDATA[
 <button onClick="lDoAttach(this)" class="clButCreative">Creative..</button> 
  ]]>
  </cell>
  </row>
  </row>
  </row>
- <row id="20081222_034311_17381132" xA="itemmedia" open="1">
  <cell image="blank.gif">Line Item</cell>
  <cell>[ORDERNUMBER]_[SITE]_[PRODUCT]_[SIZE]</cell>
  <cell>CPC</cell>
  <cell>5000</cell>
  <cell>16/12/2008</cell>
  <cell>20/12/2008</cell>
  <cell>On Hold</cell>
  <cell>5000</cell>
- <row id="20090112_100020_91795002" xA="flight">
  <cell image="blank.gif">Flight</cell>
  <cell>[ORDERNUMBER]_[SITE]_[PRODUCT]_[SIZE]_1</cell>
  <cell>CPC</cell>
  <cell>5000</cell>
  <cell>16/12/2008</cell>
  <cell>18/12/2008</cell>
  <cell>On Hold</cell>
  <cell>5000</cell>
- <row id="20090112_152318_49417904" xA="creative">
  <cell image="blank.gif" />
  <cell colspan="5">[MEDIA]</cell>
  <cell />
  <cell />
  <cell />
  <cell />
  <cell />
- <cell type="ro">
<![CDATA[
 <button onClick="lDoAttach(this)" class="clButCreative">Creative..</button> 
  ]]>
  </cell>
  </row>
- <row id="20090112_152318_49417905" xA="creative">
  <cell image="blank.gif" />
  <cell colspan="5">[MEDIA]</cell>
  <cell />
  <cell />
  <cell />
  <cell />
  <cell />
  <cell />
- <cell type="ro">
<![CDATA[
 <button onClick="lDoAttach(this)" class="clButCreative">Creative..</button> 
  ]]>
  </cell>
  </row>
  </row>
  </row>
  </rows>
Answer posted on Jan 21, 2009 05:29
Problem confirmed
To fix it you can add next line to the grid's init

grid.enableSmartXMLParsing(false)

or use updated js file instead of original one - sent by email.