Problem with rowspan in IE


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 :


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

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?

Any kind of advice would be appreciated. Thanks!


Unfortunately we cannot reproduce this issue locally. Please provide example of treeGrid initialization and exact steps to reproduce this issue.

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.


You may have some outdated code, the dhtmlxgrid_rowspan.js from version 2.5 must contain

if (tc) tc.parentNode.insertBefore(ti,tc); else ur.parentNode.appendChild(ti);

Please open ticket at or send us an email, if issue still occurs.

Thanks, it works perfectly now :slight_smile: