PDA

View Full Version : [CLOSED] Sum all values of a column and display them in DisplayField



osef
Mar 02, 2015, 3:02 AM

Daniil
Mar 02, 2015, 12:34 PM
Hi @osef,


but It doesnt works

Please clarify what happens instead. A wrong sum? A JavaScript error? Something else?

A runnable test case would be appreciated. In this way, we could help as soon as possible.

osef
Mar 03, 2015, 12:20 AM
Ok I can sum the values of column, but I do the job in this event



<AfterRender Handler="GetColumnTotal(this,6);" Delay="2000" />


this event runs in the grid but I need to put delay 2000 because the data is a lot and without delay doesnt work, I need to run this function when the store ends to load data, thanks

Daniil
Mar 03, 2015, 9:09 AM
I would try to handle a Store's Load event.

osef
Mar 03, 2015, 2:54 PM
Yes, it works, thanks

sateeshdasarikapil
Mar 13, 2015, 10:19 AM
<script type="text/javascript">
var getRate = function(grid, column) {
var values = [];
var rate = 1;
var store = grid.getStore();
grid.getStore().each(function(record) {
values.push(record.get(column));
});
for (var x = 0; x < values.length; x++) {
rate = values[0];
break;
}
return rate;
}
</script>


------------------------------------------------------------------
<ext:Parameter Name="GridRate" Value="getRate(grdPurchaseVoucher, 'ExchangeRate')"
Mode="Raw" />