我有一个网格,我想获取一列的所有值并得到总和。我已经尝试过网格摘要,但无法正常工作。
这是我的网格代码:
Ext.ns('dlti.view.widget');
Ext.define('dlti.view.widget.PlaylistDetailsGrid' ,{
extend: 'Ext.grid.Panel',
id: 'playlist-details',
alias: 'widget.PlaylistDetailsGrid',
forceFit: true,
stripeRows: true,
selType: 'rowmodel',
autosync: true,
height: 150,
width: 950,
store: new dlti.store.PlaylistDetailsStore(),
columns: [
{
text: 'Filename',
dataIndex: 'filename',
renderer: function renderDescTarget(val, p, record) {
var desc = '';
desc = '<p style="color:#000;font-size:12px;">' + val + '</p>';
return desc;
}
},
{
text: 'Transition',
dataIndex: 'transition',
renderer: function renderDescTarget(val, p, record) {
var desc = '';
desc = '<p style="color:#000;font-size:12px;">' + val + '</p>';
return desc;
}
},
{
text: 'Stay Time',
dataIndex: 'timeframe',
renderer: function renderDescTarget(val, p, record) {
var desc = '';
desc = '<p style="color:#000;font-size:12px;">' + val + '</p>';
return desc;
}
}
]
});
请帮我。我真的需要完成我的项目。
编辑
Ext.define('dlti.store.PlaylistDetailsStore', {
extend: 'Ext.data.Store',
model: 'dlti.model.PlaylistDetailsModel',
storeId: 'playlist-details',
proxy: {
type: 'memory',
autosync: true,
reader: {
type: 'json',
root: 'result'
}
}
});