52,797
社区成员
发帖
与我相关
我的任务
分享
在你返回store的数据的时候,把totalCount带过来
totalCount 有这个配置项了就会有共多少条记录了。
看看你的数据格式是不是这样的
{
totalCount: 2000, // Reader's configured totalProperty
objectsToConvertToRecords: [
{ clientId: 1, firstname: 'Bill', occupation: 'Gardener' },
{ clientId: 2, firstname: 'Ben' , occupation: 'Horticulturalist' },
]
}
bbar: new Ext.PagingToolbar({
pageSize: 5,
store: this.store,
displayInfo: true,
displayMsg: "显示第{0}-{1}条,共有{2}条记录",//这里是动态显示,带格式化字符串的;
emptyMsg: "没有记录"
}),
reader: new Ext.data.JsonReader({
root: "users",
totalProperty: "totals"//从后台取得的记录总数
注意分页带上this.store.load({params: {start: 0, limit: 5}});不然分页是没有效果的