Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Oct 31, 2008 01:17
open dhtmlx forum
Autocalculation in footer

Im using {#stat_total} in footer and I want to add one more footer bellow with this logic:

Column A Column B
footer 1: sum:, {#stat_total},{#stat_total}
footer 2: diff:, {#Column A- Column B}, {#Column B- Column A}

Is it possible?

BTW: Im using smartRendering
Answer posted by Support on Oct 31, 2008 03:50
You can add footers as
groi.attachFooter("<div id='summ1'>{#stat_total}</div>,<div id='summ2'>{#stat_total}</div>")
groi.attachFooter("<div id='summ3'></div>,<div id='summ4'></div>")
and  next logic to the grid

grid.attachEvent("onStatReady",function(){
    var sum1=document.getElementById("summ1");
    var sum2=document.getElementById("summ2");
    var sum3=document.getElementById("summ3");
    var sum4=document.getElementById("summ4");

sum3.innerHTML = sum1.innerHTML - sum2.innerHTML
sum4.innerHTML = sum2.innerHTML - sum1.innerHTML

})