以下是我的代码,显示一个包含总费用摘要的网格面板.我想用平均值显示另一个摘要行.那有什么帮助吗?
Ext.require(['Ext.data.*', 'Ext.grid.*']);
Ext.onReady(function() {
Ext.define('NewEstimate', {
extend: 'Ext.data.Model',
fields: ['description', 'cost'],
validations: [{
type: 'length',
field: 'description',
min: 3
}, {
type: 'int',
field: 'cost',
min: 1
}]
});
var rowEditing = Ext.create('Ext.grid.plugin.RowEditing');
var store = Ext.create('Ext.data.Store', {
autoLoad: true,
autoSync: false,
model: 'NewEstimate',
proxy: {
type: 'rest',
url: 'app.php/users',
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json'
}
},
listeners: {
write: function(store, operation){
var record = operation.records[0],
name = Ext.String.capitalize(operation.action),
verb;
if (name == …
Run Code Online (Sandbox Code Playgroud)