日期:2014-05-16 浏览次数:20473 次
{start : 0, limit : 20}
------解决方案--------------------
userInfoStore.load({params : {start : 0, limit : 20}});
如果是第二页就
userInfoStore.load({params : {start : 2, limit : 20}});
以此类推白
------解决方案--------------------
当前第几页:(start / limit) + 1
------解决方案--------------------
打开源码PagingToolbar.js
找到
onLoad : function(store, r, o){
if(!this.rendered){
this.dsLoaded = [store, r, o];
return;
}
var p = this.getParams();
this.cursor = (o.params && o.params[p.start]) ? o.params[p.start] : 0;
var d = this.getPageData(), ap = d.activePage, ps = d.pages;
this.afterTextItem.setText(String.format(this.afterPageText, d.pages));
this.inputItem.setValue(ap);
this.first.setDisabled(ap == 1);
this.prev.setDisabled(ap == 1);
this.next.setDisabled(ap == ps);
this.last.setDisabled(ap == ps);
this.refresh.enable();
this.updateInfo();
this.fireEvent('change', this, d);
}
------解决方案--------------------
应该是找到下面这段
doLoad : function(start){
var o = {}, pn = this.getParams();
o[pn.start] = start;
o[pn.limit] = this.pageSize;
if(this.fireEvent('beforechange', this, o) !== false){
this.store.load({params:o});
}
}
------解决方案--------------------