ext.PagingToolbar 分页问题

 

var typelistStore =new Ext.data.JsonStore({
     url: '<%=path %>/Type_showTypeByCommunityId.action?',
     baseParams: {'anType.start': 0, 'anType.limit': 1, 'anType.communityId':communityId},
     root: 'datas',
     fields: ['typeId', 'typeName','typeOrder','communityId','state'],
     autoLoad: true
    });

 

 bbar: new Ext.PagingToolbar({
    store: typelistStore,
          displayInfo: true,
             displayMsg:"显示 {0} - {1} 条 共 {2} 条",
             emptyMsg: "无显示数据",
             pageSize: 1,
             doLoad: function(start){
             this.store.load({params: {'anType.start': start}});
    
    }})

 

这样时系统一直翻页时报错,查了很长时间终于找到了原因改为

bbar: new Ext.PagingToolbar({
    store: typelistStore,
          displayInfo: true,
             displayMsg:"显示 {0} - {1} 条 共 {2} 条",
             emptyMsg: "无显示数据",
             pageSize: 1,
             doLoad: function(start){

             this.store.baseParams.start = start;
             this.store.load({params: {'anType.start': start}});
   
    }})

 

        这样就可以了主要原因是this.store.baseParams.start = start;这句话的添加,具体分析了下原因是传递参数名称anType.start这个的原因,如果将参数名称改为start就不会出现这个问题,Ext.PagingToolbar里面翻页机制传递的参数名称就是start,如果如果传递的参数重名的话this.store.baseParams.start的值自动传入了start否则要单独赋值

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值