PDA

View Full Version : Sync ajax store to offline site



bstras21
1 Dec 2011, 1:38 PM
Hello I am trying to sync my ajax store to my localStorage. I can see that the key gets set but I can't load any data.



onLaunch: function() {
languageStore = this.getLanguageStoreStore();

languageStore.load({
scope : this,
callback: function(records, operation, success) {
var newPunchStore = Ext.create('Ext.data.Store', {
model: 'myApp.model.LanguageModel',
storeId: 'myOffline',
proxy: {
type: 'localstorage',
id: 'hopethisworks',
reader: {
root: 'data',
idProperty: 'ID',
successProperty: 'result',
}
}
});


newPunchStore.load(languageStore);
newPunchStore.sync();



}

})
},

bstras21
2 Dec 2011, 7:36 AM
Ok, I just tried the exact example from:

http://docs.sencha.com/touch/2-0/#!/api/Ext.data.proxy.LocalStorage

and I'm getting the same results. Wondering if PR2 has issues with this?

rdougan
3 Dec 2011, 3:42 PM
Yup, sorry. There is a bug for this already opening for PR2. It will be fixed before GA.