Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Olivier Giovanelli on Oct 20, 2009 01:47
open dhtmlx forum
dhtmlxgrid and attachfooter

Hi,

i use the dhtmlx pro version and i have a question about the attachfooter use.

I am doing:

mygrid.attachFooter('Total:,#stat_total,#stat_total,,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total');

all is okay for the #stat_total but on the 4rd column, i need to make a calcul between the 2nd and 3rd column in the attached footer. (calcul will be : 3rd / 2nd * 100)

How can i do that ?

Secondly, something is strange.

mygrid.attachFooter('Moyenne:,#stat_average,#stat_average,,#stat_average,#stat_average,#stat_average,#stat_average,#stat_average,#stat_average,#stat_average');
mygrid.attachFooter('Total:,#stat_total,#stat_total,,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total');

all is okay with these 2 lines.

mygrid.attachFooter('Total:,#stat_total,#stat_total,,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total,#stat_total');
mygrid.attachFooter('Moyenne:,#stat_average,#stat_average,,#stat_average,#stat_average,#stat_average,#stat_average,#stat_average,#stat_average,#stat_average');

If averange is after , total ... all column are empty.

Any explanation ?

Best regards,

Olivier Giovanelli
Answer posted by Stanislav (support) on Oct 20, 2009 02:23
>>setFooterLabel

mygrid.attachEvent("onStatReady",function(){
   var c3 = mygrid.getFooterLabel(3);
   var c2 = mygrid.getFooterLabel(2);
   var res = c3/c2*100;
   mygrid.setFooterLabel(4,res);
})

>>Secondly, something is strange.
You have 10 parameters when using stat_average and 11 parameters when using stat_totals, is it expected or a typo?
Does your gird have enough columns for 11 values ?


Answer posted by Olivier Giovanelli on Oct 20, 2009 02:43
All work great... and you are right, the problem was 11 values instead of 10.

Thank you :)