Refreshing grid not working after store.sync();

China☆狼群 提交于 2019-12-11 09:52:47

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!