Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Scott Bailey on Nov 27, 2007 07:12
open dhtmlx forum
Javascript error

Hello,

We now have the professional version of the whole suite and I am having a small problem with an annoying javascript error that does not stop anything working but shows up as a warning in the status bar.

in i.e. the error is childNodes is null or not an object

if firebug console the error is

z.cells[z._childIndexes ? z._childIndexes[parseInt(cin)] : cin] has no properties
getHeaderCol(28)

Any ideas?

Scott
Answer posted by Support on Nov 27, 2007 09:39
Mentioned error appears in getHeaderCol function, which can be called only in two cases

a) by manual API call
b) during full serialization

The error itself can appear only if grid not initialized yet ( header values requested before grid.init executed ) or you calling function for not existing column - basically problem may be solved by moving function call after grid.init command.
Also, if you not know from where call generated, you can just add check similar to next.


   this.getHeaderCol = function(cin){
                     var z=this.hdr.rows[1]
                      var t=z.cells[z._childIndexes?z._childIndexes[parseInt(cin)]:cin];
                      if (t) return t.childNodes[0].innerHTML;
                      return "";
                  }