Sencha Touch ListPaging TotalCount not being set -
Sencha Touch ListPaging TotalCount not being set -
using sencha touch 2.3.1a. have list uses listpaging:
{ xtype: 'list', itemid: 'passdownlist', store: 'passdownentrysstore', plugins: [ { xclass: 'ext.plugin.listpaging', autopaging: true } ], grouped : true, itemtpl: '<div class="list-item-title">{time}</div><div class="list-item-narrative">{firstname} {lastname}</div>', selectedcls: 'list-item-module', itemcls: 'list-item-custom', onitemdisclosure: true, }
using next store proxy settings:
proxy: { type: 'ajax', actionmethods: { read : 'post' }, extraparams : { }, url: app.config.config.baseurl() + 'subscriptions/', reader: { type: 'json', totalproperty: 'totalcount', //totalcount: 'totalcount', //total: 'totalcount', rootproperty: 'data.items', successproperty: 'success' } }
this info returned server:
i've tried 3 reader settings:
totalproperty: 'totalcount', //totalcount: 'totalcount', //total: 'totalcount',
and totalcount 'undefined'. tried add together load event on store update total count:
load: function(records, successful, operation, eopts) { var info = json.parse(eopts._response.responsetext); this.settotalcount(data.data.totalcount); console.log('load phone call total: ' + this.gettotalcount()); }
which sets it. when pull list show more entries , inspect total count in load event been reset 'undefined' again. reason why want work shows "no more records"
update: 6/18/2014: setting on load worked me:
load: function(records, successful, operation, eopts) { var info = json.parse(eopts._response.responsetext); this.settotalcount(data.data.totalcount); console.log('load phone call total: ' + this.gettotalcount()); }
this why keeps setting totals. still dont understand why comes undefined though missing/bug. solves problem paging
actually setting totalproperty: 'count'
@ reader config worked me, while interacting rest api, update working too.
example of proxy settings (btw it's not in store configs, in model)
proxy: { type: 'rest', url : 'https://*******.info/api/v3/posts/', withcredentials: false, usedefaultxhrheader: false, reader : { type : 'json', rootproperty : 'results', totalproperty : 'count' } //format :'json' }
sencha-touch
Comments
Post a Comment