81,092
社区成员
发帖
与我相关
我的任务
分享
Ext.get("ext-search").on('click', function(){
var StudentRecord = new Ext.data.Record.create([
{name:'name',type:'string'},
{name:'mobile',type:'string'},
]);
var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'U_Login_getAllUsersInfo.action'
}),
reader: new Ext.data.JsonReader({
root: 'jsonOperatorList',
totalProperty: 'totalCount',
id: 'main_user_id'
},StudentRecord),
remoteSort:true
});
var sm = new Ext.grid.CheckboxSelectionModel();//checkbox
var cm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),//显示行号
sm,
{header:'用户名',dataIndex:'name',width:100,sortable:true },
{header:'电话',dataIndex:'mobile',width:100,sortable:true}
]);
cm.defaultSortable = true;
var grid = new Ext.grid.GridPanel({
height: 500,
store: ds,
cm: cm,
sm: sm,
bbar: new Ext.PagingToolbar({
pageSize: 5, //每页显示几条数据
store: ds,
displayInfo: true,
displayMsg: '正在显示第 {0} 条至第 {1} 条数据,共 {2} 条数据',
emptyMsg: "当前没有可以显示的数据"
})
});
grid.render('grid-div');
ds.load({params:{start:0, limit:5}});
});