extjs 列的摘要,其值与前 2 列相乘
正如标题问题中所说,最后一列的摘要不起作用,代码如下:
,{
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');
}
所以乘法按预期工作,但总和始终保持为 0,有什么想法吗?
我还尝试指定自定义的summaryType,如下所示:
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');
},
但这会导致 ExtJs 问题错误:
Ext.ux.grid.GroupSummary.Calculations[cf.summaryType] 不是 函数源文件:/lib/ext/ux/GroupSummary.js 行:124
有什么想法吗?
谢谢
As it has been 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论