Problem with DHTMLX Grid columns

I’m reusing a grid within a layout (using AttachGrid), to get different sets of data from a server.

It seems that in some situations, not sure yet when, I’m getting the following error on IE8 (not sure about other browsers):
‘this.hdr.rows.0.cells[…]’ is null or not an object

Checkinh this, I see that:
this.hdr.rows[0].cells[ind] is null because ind=18, while this.hdr.cells.length=18

It occurs when I change between tables with different header-column length.

I was able to workaround that by doing (before I reuse the grid):
grid.clearAll(true);
grid._ivizcol=[]; //HACK to DHTMLX issue, waiting for a fix.
grid.parse(gridXml);

This seems to solve the problem, but the root cause is unclear to me and I don’t want to hack into DHTMLX private API.

Does this ring any bell or do I must put the effort on a complete working repro?

We need complete demo to reproduce and debug this issue

Here is a working Demo.
The example, as is, can replace the /12_initialization_loading/07_init_grid.html

The key is to have grids with different column length such that in the second grid beign loaded, the array of hidden column is triggering a call to hide a non existing column in the second grid.
Sample07.zip (2.12 KB)