extjs summary of column which values has multiplication of previous 2 columns
As it has been 开发者_JAVA技巧said in title problem is that summary of last column doesn't work, here is the code:
,{
id: 'result_id',
header: " ",
sortable: true,
dataIndex: 'result',
width: 100,
renderer: function (value, style, record, row, col, store, grid) {
return Ext.util.Format.number(record.get('prew1') * record.get('prew2'), '0.00');
},
summaryType: 'sum',
summaryRenderer: function(v) {
return Ext.util.Format.number(v, '0.00');
}
So multyplication works as expected but sum always stay 0, any thoughts?
I tryed also to specify custom summaryType like this:
summaryType:function (values) {
var result = [], retval;
Ext.Array.forEach(values, function (record){
result.push(record.get('area') * record.get('yield'));
});
retval = Ext.Array.mean(result);
return Ext.util.Format.number(retval, '0.00');
},
But that couse a ExtJs problem Error:
Ext.ux.grid.GroupSummary.Calculations[cf.summaryType] is not a function Source File: /lib/ext/ux/GroupSummary.js Line: 124
Any ideas?
Thanks
精彩评论