赞
踩
createPaging:function(pageSize,store){
this.option={
items:['-'],
store:store,
displayInfo:true,
pageSize:pageSize,
displayMsg:'{0}-{1}/{2}',
emptyMsg:KQinfo.msg.notRecords
};
if(this.dynamicPageSize){
var pageStore=new Ext.data.ArrayStore({
fields:['value','text'],
data:this.dynamicPageRecords
});
this.pageCombo=new Ext.form.ComboBox({
width:60,
mode:'local',
editable:false,
typeAhead:true,
value:pageSize,
store:pageStore,
valueField:'value',
displayField:'text',
selectOnFocus:true,
triggerAction:'all',
forceSelection:true
});
this.option.items.push({xtype:'displayfield',value:KQinfo.btn.dynamicPage},this.pageCombo);
}
var pagingBar=new Ext.PagingToolbar(this.option);
if(this.dynamicPageSize){
this.pageCombo.on('select',function(combo){
this.pageSize=combo.getValue();
pagingBar.pageSize=this.pageSize;
this.store.reload({params:{start:0,limit:this.pageSize}});
},this);
}
this.bbar=pagingBar;
delete this.option;
},
createStore:function(){
if(Ext.isEmpty(this.storeMapping))throw 'storeMapping undefined...';
var gridStore=new Ext.data.JsonStore({
root:"gridRows",
remoteSort:true,
url:this.actionUrl,
fields:this.storeMapping,
totalProperty:"totalCount"
});
gridStore.on('loadexception',function(s,r,response){
var status=response.status;
if(status=='401'||status=='500'||status=='404'){
parent.location.href=path+KQinfo.loginUrl;
}
},this);
gridStore.baseParams=this.params||{};
if(this.hasPage){
gridStore.load({params:{start:0,limit:this.pageSize}});
this.createPaging(this.pageSize,gridStore);
}else{
gridStore.load();
}
this.store=gridStore;
},
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。