【发布时间】:2015-04-20 18:46:50
【问题描述】:
在 JSON 中,我的总数为 67,但在网格上仅显示两条记录。分页工具栏显示 msg "Displaying 1 - 2 of 2" 并且下一个和上一个按钮也被禁用 下面是我的 js 文件的代码。 如何验证 totalProperty 的总数是否正确?
Ext.onReady(function(){
var simpsonsStore = Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
pageSize: 2,
autoLoad: false,
buffered: true,
fields: ['name', 'email', 'phone'],
proxy: {
type: 'ajax',
pageParam: undefined,
url: '/apex/getPatientData',
startParam: 'start',
limitParam: 'limit',
noCache: false,
reader: {
type: 'json',
root: 'items',
totalProperty: 'total'
}
},
});
simpsonsStore.load({
params: {
start: 0,
limit: 2
}
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [{
header: 'Name',
dataIndex: 'name'
}, {
header: 'Email',
dataIndex: 'email',
flex: 1
}, {
header: 'Phone',
dataIndex: 'phone'
}],
height: 200,
width: 400,
dockedItems: [{
xtype: 'pagingtoolbar',
store: simpsonsStore,
dock: 'bottom',
displayInfo: true
}],
renderTo: Ext.getBody()
});
});
【问题讨论】:
标签: ajax json extjs proxy store