[英]EmberData unloadAll doesn't work on IE8. Works on Chrome/FireFox
Thanks in advance for the help ! 先谢谢您的帮助 !
I am having a problem refreshing my model on IE8. 我在刷新IE8上的模型时遇到问题。 (Works on Chrome Chrome and Firefox) I run this code to refresh my model with a request to the database using my adapter.
(适用于Chrome,Chrome和Firefox)我运行此代码,以使用适配器向数据库发出请求来刷新模型。 Through this command I am unloading the data of the model and reloading it again to display it to the user:
通过此命令,我正在卸载模型的数据,然后再次重新加载以将其显示给用户:
var type = self.controller.get('model').type;
this.controller.get('model').get('store').unloadAll(type);
this.controller.get('model').get('store').fetchAll(type);
No Javascript errors. 没有Javascript错误。 I have looked for a solution but not a clue about it.
我一直在寻找解决方案,但没有线索。 Any idea?
任何想法?
Thanks ! 谢谢 !
EDIT : I got a solution. 编辑:我有一个解决方案。 IE8 was caching my fetchAll() method from Ember Data.
IE8从Ember Data缓存了我的fetchAll()方法。 The solution was to manually set on the response header that I didn't want Cache:
解决方案是手动在不需要缓存的响应标头上设置:
Cache-Control:no-cache Content-Type:application/json Date:Tue, 31 Mar 2015 09:35:48 GMT Pragma:no-cache Server:Apache-Coyote/1.1 Transfer-Encoding:chunked Cache-Control:no-cache内容类型:application / json日期:Tue,31 Mar 2015 09:35:48 GMT Pragma:no-cache服务器:Apache-Coyote / 1.1 Transfer-Encoding:chunked
Thanks !! 谢谢 !!
Problably this is because you are directly accessing the type and ie8 doesn't support computed properties. 可能是因为您直接访问类型,而ie8不支持计算属性。 Can you check using proper Ember getters?
您可以使用正确的Ember吸气剂检查吗?
var type = self.controller.get('model.type');
this.controller.get('model').get('store').unloadAll(type);
this.controller.get('model').get('store').fetchAll(type);
You can also try access controllers like this: var type = self.get('controller.model.type'); 您也可以尝试这样的访问控制器:var type = self.get('controller.model.type');
this.get('controller.model.store').unloadAll(type);
this.get('controller.model.store').get('store').fetchAll(type);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.