store.sync();刷新网格不工作 [英] Refreshing grid not working after store.sync();
问题描述
我已经将成功的数据添加到服务器中,并将json添加回来,以使我有成功= true。添加后,我的网格不会同步数据(刚刚刷新后用F5)。在成功的处理程序中,我已经:
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.
ve尝试了这个:
Ext.getCmp('workerlist').getView().refresh();
我尝试过stackoverflow中的所有示例。 :
推荐答案
我相信你是...
sync();
不是加载数据的正确方法。你应该尝试
sync();
is not the correct method for loading data. You should try
var store = Ext.getStore('Workers');
store.load();
一个网格将自己绑定到一个商店,所以如果你重新加载商店,网格总是会这样做,但是当调用 refresh()
时,网格不会导致存储上的加载。您也可以尝试从 Ext.getCmp('my-grid')中获取网格并访问商店。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();
这篇关于store.sync();刷新网格不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!