`
mywebcode
  • 浏览: 999882 次
文章分类
社区版块
存档分类
最新评论

sencha touch笔记(9)——listpaging‘分页’拉取数据

 
阅读更多

后台在向前台返回数据时肯定是以分页的形式来返回的,很少会有直接一坨都全部返回给前台。那么前台就需要分页的去接收来自后台的数据。

ST里面的listpaging组件就是用来做分页的,它在页面最下方添加了一个‘load more‘的按钮,点击的时候会自动将下一页的数据加载进相对应的store,并且可以的话会在对应的位置显示出来。

使用listPaging进行分页显示的方法,重写了里面的nextPage的函数:

nextPage: function(options) {
if(this.currentPage2 == null) {
this.currentPage2 = 1;
}
this.currentPage2 = this.currentPage2 + 1;
this._proxy._url = 'http://121.199.60.94/picourse/index.php/HighCourse/getHighCourseByPage/page_num/'+this.currentPage2;

this.loadPage(1, options);
}

亲测可以,不过对于ST中的options还是有一些困惑。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics