Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jason on Mar 09, 2009 14:40
open dhtmlx forum
Math Column plus Footer not recalculating

I have 5 columns that I want to sum to a total column at the end. I am using "ron[=c3+c4+c5+c6+c7]" for the total, and that works great. I then attach a footer under the 5 columns and the total: "{#stat_total},{#stat_total},{#stat_total},{#stat_total},{#stat_total},{#stat_total}". The footers work great for the 5 regular columns.

However the last column footer does not recalculate. The 5 standard columns recalculate and the last column recalculates each row but that total column in the footer will not recalculate. When the grid initially loads the calculation is correct, but upon changing nothing happens.
Answer posted by dhxSupport on Mar 10, 2009 03:22
Answer posted by dhxSupport on Mar 10, 2009 04:01
Also you can attach "onEditCell" event and call "onGridReconstructed" event to recalculate all footers:

mygrid.attachEvent("onEditCell",function(stage,rowId,cellInd,newValue,oldValue){
        if ((stage==2)&&(newValue!=oldValue)){
            mygrid.callEvent("onGridReconstructed",[]);
                                return true;
        }
return true;
    });