Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by jake on Aug 20, 2008 06:06
open dhtmlx forum
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
Answer posted by Support on Aug 20, 2008 07:26
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. 
Attachments (1)