---
title: "sencha touch笔记（9）——listpaging‘分页’拉取数据"
author: "mywebcode"
date: "2013-12-26T01:57:00Z"
tags: []
slug: "sencha-touch-9-listpaging"
draft: false
lastmod: "2014-04-30T09:04:21Z"
id: 2057479
url: "https://mywebcode.iteye.com/blog/2057479"
---

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

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还是有一些困惑。