在使用Ext2.0的分页工具栏时出现了问题,它默认使用上次列表的查询参数,而不是使用Store中定义的参数。
var store = new Ext.data.JsonStore({
url: 'dbconfigAction?uisessionid='+uisessionid,
baseParams :Ext.apply({act:'query'},{param_query:'query'},{targetId:gridMeta.targetId}),
pruneModifiedRecords:true,
root: 'result',
totalProperty: 'totalCount',
fields: gridMeta.fields
});
new Ext.PagingToolbar({width:380,pageSize:5,store:store,displayInfo:true,border:false})
query : function(queryParam){
if(queryParam!=null && queryParam!='undefined'){
Ext.apply(this.store.baseParams,queryParam);
}
Ext.apply(this.store.baseParams,{act:'query'},{param_query:'query'});
this.store.load({params:{start:0,limit:this.pageSize}});
},
loadData : function(queryParam){
if(queryParam!=null && queryParam!='undefined'){
Ext.apply(this.store.baseParams,queryParam);
}
Ext.apply(this.store.baseParams,{act:'query'},{param_query:'load'});
this.store.load({params:{start:0,limit:this.pageSize}});
},
在初始化页面时调用的是loadData函数,在查询的时候调用的是query函数。分页是自己在后台写到功能。
初始化页面后点击下一页,传到后台的参数和使用loadData函数一样,分页不能用。
查询后后点击下一页,传到后台的参数和使用query函数一样,分页能用。
请指点一下,怎么处理?

请教:EXT 分页工具栏默认使用上次列表的查询参数,而不是使用Store中定义的参数
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-