当前位置:   article > 正文

extjs重新激活grid_【extjs3.2】grid重新加载jsonstore后,点击grid上的分页组件,grid不刷新...

extjs store 本地json 分页

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;

},

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/322295
推荐阅读
相关标签
  

闽ICP备14008679号