:: Forum >>

total in footer

Do you have a example with totals in the footer for one ore more colums?
I tried to look at aan existing example but de link dos not work.
Johan
Wednesday, January 2, 2008
Hi, yeah my old link example doenst work, ill try to fix that later and upgrade to 2.5.1.
Here the simple way to do:
<SCRIPT>
var obj = new AW.UI.Grid;
obj.setCellData(function(col, row){return col+row });
obj.setHeaderText("header");
obj.setId("abc");
obj.setColumnCount(10);
obj.setRowCount(20);
obj.setVirtualMode(true);
obj.setFooterCount(1);
obj.setFooterVisible(true);
obj.setFooterText(function(col,row) {
    var count = 0;
    for(var i=0;i<obj.getRowCount();i++)
        count += obj.getCellData(col,i);
    return count;
});
obj.setCellEditable(false);
document.write(obj);
</script>


Hope this help, cya.
Paulo Cesar (PC from Brazil)
Wednesday, January 2, 2008
my mistake, forget the last parameter in function.
<SCRIPT>
var obj = new AW.UI.Grid;
obj.setCellData(function(col, row){return col+row });
obj.setHeaderText("header");
obj.setId("abc");
obj.setColumnCount(10);
obj.setRowCount(20);
obj.setVirtualMode(true);
obj.setFooterCount(1);
obj.setFooterVisible(true);
obj.setFooterText(function(col) {
var count = 0;
for(var i=0;i<obj.getRowCount();i++)
count += obj.getCellData(col,i);
return count;
});
obj.setCellEditable(false);
document.write(obj);
</script>
Paulo Cesar (PC from Brazil)
Wednesday, January 2, 2008
It works. Thks (muinto obrigado Paulo!)
is there a way to format the result in "#,##0,00" to?
Johan
Tuesday, January 8, 2008
var number = new AW.Formats.Number;
number.setTextFormat("#,##0,00");
obj.setFooterFormat(number);


This should work.
Paulo Cesar (PC from Brazil)
Tuesday, January 8, 2008

This topic is archived.


Back to support forum

Forum search