1、grid模型:
//创建条目记录record
var record = Ext.data.Record.create([
{name: 'typeid' ,type:'int'},
{name: 'typename' ,type:'string'},
{name: 'storename', type:'string'},
{name: 'coopid', type:'int'}
]);
//表格的数据源
this.store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy(),
reader: new Ext.data.JsonReader(null, record)
});商品类别
{name: 'storename', type:'string'}
。。。。。。
2、
StoreSearchGrid.superclass.constructor.call(this,{
autoScroll:true,
region:'center',
margins:'5 5 5 0',
sm: this.sm,
bbar: new Ext.PagingToolbar({
pageSize: 18,
store: this.store,
displayInfo: true,
displayMsg: '显示第 {0} 条到 {1} 条记录,一共 {2} 条',
emptyMsg: "没有记录"
}),
viewConfig: {
forceFit:true,//让表格表头自动填充所有编办
enableRowBody:true,
showPreview:true,
getRowClass : this.applyRowClass
}
});
3、数据请求,采用ajax方式:
Ext.Ajax.request({
url: "./index.php?controller=StatQuery_Store&action=QueryBlistInfo",
method:'post',
params:{parm:parmstr},
success: function(response, option) {
var obj = Ext.decode(response.responseText);
if(obj.flag==true){
[color=red] [u] grid.setGrid(obj.data);[/u][/color]
}else{
grid.store.removeAll();
grid.Reset();
//Ext.MessageBox.alert('友情提示',obj.msg);
}
},
failure: function(response, option) {
win.body.unmask();
Ext.MessageBox.alert('友情提示',"异步通讯失败,请于管理员联系!");
},
scope:this
});
红色部分为将数据插入grid:
setGrid:function(records){
this.store.removeAll();
for(var i=0;i<records.length;i++){
var obj = records[i];
var p = new Ext.data.Record(records[i]);
this.store.insert(0, p);
}
},
问题:
分页的相关参数怎么获得,并传给后台,后台来进行分页?