PDA

View Full Version : How to refresh store after paging (rest app)



Syndicate
18 Oct 2013, 7:14 AM
hello,

my store doesn't refresh after changing pages. Pls help.

Code:
Store + proxy


store: {
model: 'Responses',
autoLoad: true,
xtype: 'store',
proxy: {
type: 'rest',
url : '/api/responses',
startParam: 'offset',
limitParam: 'limit',
pageParam: false,
reader: {
type: 'json',
root: 'data.rows',
idProperty: 'response_id',
totalProperty: 'data.total'
}
writer: {
writeAllFields: false
}
},
pageSize: 5
}


Pager



initComponent: function() {
this.bbar = Ext.create('Ext.PagingToolbar', {
store: this.getStore(),
displayInfo: true,
displayMsg: '{0} - {1} of {2}',
emptyMsg: "No data to display"
});
this.callParent();
}


Get request goes well, and response needed data









GET /api/responses?offset=0&limit=5
GET /api/responses?offset=5&limit=5
GET /api/responses?offset=10&limit=5

But store in grid doesnt refresh.

scottmartin
21 Oct 2013, 1:16 PM
What happens on the screen?
Have you verified your return JSON is correct? Does your return result return total record count?

What does your return look like for each?

Scott.