sum of inserted columns

Any body got a neat solution to inserting colums in a grid with 2 sub levels with top two levesl contain =sum cells

When I try to set this up the sum col go out of whackr??



Cheers in advance

When you creating a new column it will not contain any data inside the cells, you can try to create column as math, and set the formulas in necessary cells after that.

grid.insertColumn(index,“new”,“math”,“150”);
grid.forEachRow(function(id){
grid.cells(id,index).setValue(“=sum”);
});

If you inserting column in a middle of grid - it may break existing sum formulas. Please try to use updated js file (attached to email ) in such case.

dhtmlxgrid_mcol.zip (3.55 KB)