我使用以下代码。 我看见电网,内容正确,但页数部分奇怪。
- The button "next", "previous", ... are not enabled. There are 4 records and I ask 3 records by page, I should see "Page 1 of 2"
- How can I manage the "refresh" button.
感谢
$(document).ready(function () {
Ext.define( User , {
extend: Ext.data.Model ,
fields: [
{ name: FirstName , type: string },
{ name: LastName , type: string },
{ name: Email , type: string }
]
})
var userStore = Ext.create( Ext.data.Store , {
model: User ,
proxy: {
type: ajax ,
url: /Home/GetUsers ,
reader: {
type: json ,
root: users
}
},
autoLoad: true
});
Ext.create( Ext.grid.Panel , {
renderTo: testing ,
store: userStore,
autoScroll: true,
layout: fit ,
title: Users ,
width:450,
columns: [{
text: First Name ,
width: 225,
sortable: true,
dataIndex: FirstName ,
editor: {
xtype: textfield ,
allowBlank: false
}
},
{
text: Last Name ,
width: 225,
sortable: true,
dataIndex: LastName ,
editor: {
xtype: textfield ,
allowBlank: false
}
}],
bbar : Ext.create( Ext.toolbar.Paging , {
store: userStore,
pageSize: 3,
displayInfo: true,
displayMsg: Displaying topics {0} - {1} of {2} ,
emptyMsg: "No topics to display"
})
});
});
Update1 :
{"total":2,"success":true,"data":[{"Id":1,"FirstName":"AA","LastName":"BB"},{"Id":2,"FirstName":"CC","LastName":"DD"},{},{}]}
我看不到“2岁×”