I’m using dhtmlx treegrid(v.2.5 build 090904) and some of the grids with rowspan throw a script error only in IE8 when ‘notification about every script error’ option is enabled.
The error is occurring at line 10 in dhtmlxgrid_rowspan.js file, which is :
tc.parentNode.appendChild(ti);
And the problem is that the variable ‘tc’ is undefined so it can’t reference the ‘parentNode’ property.
I have no idea how this could happen, but there’s something I don’t understand about the code, that is :
if (tc)tc.parentNode.insertBefore(ti,tc);else
tc.parentNode.appendChild(ti);
The problem occurs when ‘tc’ is undefined, and the above if-clause is explicitly checking if it is so. However, it references ‘tc.parentNode’ regardless of its status. Is it an intended behavior or a bug? If it’s intended, then what could possibly cause the problem in my case?
It’s running on one of our clients machines of which I only have limited remote access. However, I will try to reproduce it locally and post the sample if it’s possible.
By the way, could you explain the logic behind that code I quoted please? It doesn’t seem to make any sense to check if ‘tc’ is undefined when it references its ‘parentNode’ property whether it’s undefined or not. When I change the line to ‘if (tc) … else return;’ the problem disappears.