问题
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 refreshing with F5). 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.
I've tried this too:
Ext.getCmp('workerlist').getView().refresh();
I've tried all examples from stackoverflow. :)
回答1:
I am sure you did...
sync();
is not the correct method for loading data. You should try
var store = Ext.getStore('Workers');
store.load();
A grid binds itself to a store, so if you reload the store the grid will always do so but the grid will never causing a load on the store when calling refresh()
on it. You may also try to get the grid and access the store from there like Ext.getCmp('my-grid').store.load();
来源:https://stackoverflow.com/questions/12466179/refreshing-grid-not-working-after-store-sync