标签:
目的是不要每次都加载 json文件,从而加快运行速度。
You could configure your stores with a memory proxy:
store: { model: ‘Forum.model.Post‘, proxy:{ type: ‘memory‘ reader: { type: ‘json‘ root: ‘posts‘ } } }
Then fetch the data once with an Ext.Ajax.request and load it into each store using the proxy:
Ext.Ajax.request({ url: ‘../api/json.php‘, success: function(response) { var result = Ext.JSON.decode(response.responseText); store.getProxy().data = result; store.load(); // same procedure for the other stores... } });
ExtJS stores - load JSON only once
标签:
原文地址:http://www.cnblogs.com/yuxiaoqi/p/5143558.html