PDA

View Full Version : Refreshing grid not working after store.sync();



ultigax
17 Sep 2012, 11:11 AM
I have added successfully data to server and get json back so that I have success = true. After adding, my grid doesn't sync data (just after pressing F5 for refresh whole page). In handler for success I've put:

var store = Ext.getStore('Workers');
store.sync();

I've checked and I really get store Workers but the sync is not working. :(

I think that when I reload data in store, data in grid should be also reloaded.

EDIT:

I've tried this too:

Ext.getCmp('workerlist').getView().refresh();

EDIT 2:

This worked:
var store = Ext.getStore('Workers');
store.load();

scottmartin
18 Sep 2012, 1:11 PM
Glad you got it working.

Scott.

metalinspired
18 Sep 2012, 11:17 PM
Maybe sync() didn't work because there were no changes to sync with db.
load(), on the other hand, simply loads the store, it doesn't care about any changes made.