PDA

View Full Version : Problem Retrieving totalProperty value from JsonReader inside JsonStore



aryates
27 Oct 2010, 6:47 AM
For some reason I seem to be unable to actually retrieve the totalProperty value on the load event for this store ... I've tried variations and it seems to be undefined ... I need it for my paging algorithm ... I do recognize the Store, Proxy, Reader relationships and I've tried various combinations, but it consistently doesn't seem to be available ... thoughts?

imageListInfoStore.on('load', function(store) {
console.log('imagesCount'+store.getTotalCount());
});

var imageListInfoStore = new Ext.data.JsonStore({
model: 'pacsImages',
proxy: {
type: 'ajax',
url: '/mobile/app/getImageListInfo',
extraParams: {
params: '',
sortField : '0',
sortDir : 'NONE',
mrn : '',
studyUID: '',
seriesUID: '',
start: '',
limit: ''
},
reader: {
type: 'json',
root: 'imageURLs',
totalProperty: 'imagesCount'
},
timeout: 180000 //Set to 3 minutes
},
pageSize: 16
});

aryates
27 Oct 2010, 7:47 AM
Solved it myself ...

console.log('imagesCount'+store.getProxy().getReader().rawData.imagesCount);