在Ext进行查询后 分页可以出现效果,但是单击下一页或是最后一页的时候,就会变成查询之间的效果,在网上查找了好久,找到了问题的解决方案
代码如下
// 用来进行分页操作的
//gridStore_c查询完成后的数据源 gridStore_c.on('beforeload', function(thiz, options) {
Ext.apply(thiz.baseParams, {
flag : type,
startTime : Ext.util.Format.date(startTime,
'Y-m-d')
+ " 00:00:00",
endTime : Ext.util.Format.date(endTime, 'Y-m-d'
+ " 23:59:59"),
searchData : value
});
});
gridStore_c.load({
params : {
start : 0,
limit : 20,
flag : type,
startTime : Ext.util.Format.date(startTime, 'Y-m-d')
+ " 00:00:00",
endTime : Ext.util.Format.date(endTime, 'Y-m-d'
+ " 23:59:59"),
searchData : value
},
callback : function() {
if (this.getCount() == 0) {
Ext.MessageBox.suggest("提示", "无可查询数据");
};
}
});
Ext.getCmp('botbar').bind(gridStore_c);
?添加这些代码,效果就可以出来了