insertColumn in dhtmlxgrid when multi line headers exist fai

There appears to be a bug in dhtmlxgrid (version 1.6 enterprise). If I have a grid with a 2 line header. I call setHeader and then attachHeader, a call to insertColumn then throws an error in the javascript.

To reproduce the error, take the sample file pro_grid_cols.html from the htmlxgrid samples (in rows_columns_manipulation dir) and add the following line


either before or after the mygrid.init().

When you then try to add a new column with index of 2 or more, then an error occurs.

Problem confirmed and fixed , fixed js file sent by email.

By the way , you can’t insert new column at position 2 , becuase this column already is a part of colspan

Many thanks for the patch file and prompt response.  This has fixed the problem.