Ext.onReady(function(){
var ds = new Ext.data.Store( {
//autoLoad:{params:{start:0,limit:2}},
proxy : new Ext.data.HttpProxy( {
url : 'getAllWhyzl.action'
}),
reader : new Ext.data.JsonReader( {
root : 'results',
totalProperty : 'totalCount',
id : 'IWhyid',
successProperty : '@success'
}, [ {
name : 'whyzl.IWhyid',
mapping : 'IWhyid'
}, {
name : 'whyzl.CWhyno',
mapping : 'CWhyno'
}, {
name : 'whyzl.CWhyname',
mapping : 'CWhyname'
}, {
name : 'whyzl.IDeptid',
mapping : 'IDeptid'
}, {
name : 'whyzl.CPhone',
mapping : 'CPhone'
}, {
name : 'whyzl.CWhyStatus',
mapping : 'CWhyStatus'
}])
});
var grid = new Ext.grid.EditorGridPanel({
collapsible : true,
animCollapse : false,
iconCls : 'icon-grid',
store : ds,
renderTo : 'topic-grid',
columns:[new Ext.grid.RowNumberer(), {
id : 'id',
header : '内编号',
dataIndex : 'whyzl.IWhyid',
width : 40
}, {
header : "人员编号",
dataIndex : 'whyzl.CWhyno',
editor:new Ext.form.TextField({
allowBlank:false
}),
width : 50,
sortable : true,
locked : false
}, {
header : "人员姓名",
dataIndex : 'whyzl.CWhyname',
editor:new Ext.form.TextField({
allowBlank:false
}),
width : 100
},{
header : "人员类型",
dataIndex : 'whyzl.IDeptid',
editor:new Ext.form.TextField({
allowBlank:false
}),
width : 100
}, {
header : "联系方式",
dataIndex : 'whyzl.CPhone',
editor:new Ext.form.TextField({
allowBlank:false
}),
width : 100
}, {
header : "工作状态",
dataIndex : 'whyzl.CWhyStatus',
width : 100
}
],
viewConfig : {
forceFit : true
},
sm:new Ext.grid.RowSelectionModel(),
bbar:new Ext.PagingToolbar( {
pageSize : 1,
store :ds,
displayInfo : true,
displayMsg : '显示 {0}-{1}条 / 共 {2} 条',
emptyMsg : "无数据。",
items : ['-', {
pressed : true,
enableToggle : true,
text : '按钮',
cls : 'x-btn-text-icon details'
}]
})
怎么写分页啊?
是store那加个属性:autoLoad:{start:0,limit:2},
我总是显示所有
是不是在后台还要进行什么转换啊