If you use ajax proxy for storage, smth like
proxy : {
type : 'ajax',
url : 'YOUR URL',
reader : {
type : 'json',
root : 'NAME OF YOUR ROOT ELEMENT',
totalProperty : 'NAME OF YOUR TOTAL PROPERTY' // requiered for paging
}
}
and then load your store as store.load (); An asynchronous Ajax request will be sent, so you should check the counter in the callback like this
store.load({
callback : function(records, operation, success) {
console.log(this.getCount());
console.log(this.getTotalCount());
console.log(records.length);
}
});
source
share