简体   繁体   中英

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. (Works on Chrome Chrome and Firefox) I run this code to refresh my model with a request to the database using my adapter. 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. 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. 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

Thanks !!

Problably this is because you are directly accessing the type and ie8 doesn't support computed properties. Can you check using proper Ember getters?

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');

this.get('controller.model.store').unloadAll(type);
this.get('controller.model.store').get('store').fetchAll(type);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM