我正在使用gridjo和dojo 1.8.3库。
我的应用程序需要使用来自服务器的数据每秒刷新一次dojo网格。
以下是刷新网格并为每次刷新创建一个新存储的代码。 结果出现在xhrPost回调中,并被分配到新的网格商店。 当dojo网格刷新时观察到内存泄漏
refreshGrid(){
if(grid.store!=null)
grid.store.close();
var newGridStore = new dojo.data.ItemFileWriteStore({
url:'',
data:result,
urlPreventCache: false
});
grid.setStore(newGridStore);
}
以上功能是越来越要求每2秒,我可以在Chrome中看到资料内存增加。
我曾尝试使用这种方式遍历商店,删除所有商品,然后添加新商品,但商店更新时网格被锁定。
哪个是dojo网格刷新的正确方法?
听起来你想实现[实时存储](http://dojotoolkit.org/documentation/tutorials/1.9/realtime_stores/)。 –