sencha touch 2 滚动分页

js 方面 我没有用mvc 模式 简单实现以下功能

先写store

me.pigFileStore = Ext.create("Ext.data.Store", {
id : 'pigFileStore',
fields : ['pigpenNumber','name'],
pageSize:10,  //*注意这里 要写上每页显示多少条 不然会无限翻页的 
proxy : {
type : 'ajax',
url : totalPath + '/mobile/mobilePigPen!phonePagedQuery.action',
reader : {
type : 'json',
rootProperty : 'data',
totalProperty : 'totalCount'   //后台需要返回一个总条数对象 
}
},
autoLoad : true,
listeners : {
    load : function(scope, record) {
    console.log(record);//我测试用的  习惯了
    }
}
});

下面是list  //API直接复制的   西面是分页 也是从别人那里借鉴的

me.pigFileList = Ext.create("Ext.List", {
store : me.pigFileStore,
itemTpl: '{pigpenNumber}</br>{name}',
            iconCls: 'home',
onItemDisclosure: function(record) {
alert(record.data.id);
console.log(record.data.name);
},
plugins : [/*{
                xclass : 'Ext.plugin.PullRefresh',
                pullRefreshText : '下拉可以更新',
                releaseRefreshText : '松开开始更新',
                loading : '正在刷新……',
                refreshFn : function(loaded, arguments) {
                    loaded.getList().getStore().loadPage(1, {
                        callback : function(record, operation, success) {
                            Ext.Viewport.unmask();
                        },
                        scope : this
                    });
                }
            },*/   //这一部分注释掉了  这一部分是从上往下拉时的  我暂时没用上   

//下面就是滚动分页的实现了

   {
                xclass : 'Ext.plugin.ListPaging',
                 loadMoreText : '上拉显示更多……',
                noMoreRecordsText : '没有更多条记录了',
                autoPaging : true
                    // 设置为TRUE将自动触发
                }]


});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值