Hi all,
I'm hoping someone can tell me where I'm going wrong with this ST 2.1 app.
I'm unable to 'save' my data to my localstorage for some reason. When going offline, the offline store's empty 
Code:
CACHE MANIFEST
# 16.212
index.html
#app/localstore.js
lib/sencha-touch-all-debug.js
css/apple.css
css/next24.css
NETWORK:
*
Code:
Ext.application({
name: 'Next24',
launch: function() {
Ext.define('Movies',{
extend: 'Ext.data.Model',
config: {
idProperty: 'slotid',
fields:[
'slotid',
'title',
'summary'
]
}
});
var onlineStore = Ext.create('Ext.data.Store', {
model: 'Movies',
storeId: 'online',
autoLoad: false,
proxy: {
type: 'jsonp',
timeout: 10000,
url: 'http://next24.tv/getdata',
reader: {
type: 'json',
rootProperty: 'MovieSchedule'
}
},
listeners: {
load: function() {
if (navigator.onLine) {
Ext.getStore('offline').getProxy().clear();
this.each(function(record){
offlineStore.add(record.data);
});
Ext.getStore('offline').sync();
}
else {
//offlineStore.load();
}
console.log('Online Store Loaded with ' + onlineStore.getCount() + ' records, Offline Store has: ' + offlineStore.getCount());
}
}
});
var offlineStore = Ext.create('Ext.data.Store', {
model: 'Movies',
storeId: 'offline',
autoLoad: false,
proxy: {
type: 'localstorage',
id: 'Next24-Offline'
},
listeners: {
load: function(s) {
console.log('offlineStore has ' + s.getCount() + ' items')
}
}
});
var schedule = Ext.create('Ext.DataView', {
fullscreen: true,
itemTpl: '{title}: {summary}',
store: 'offline',
scrollable : {
direction: 'vertical',
directionLock: true
},
listeners: {
initialize: function() {
var onlineProxy = onlineStore.getProxy();
onlineProxy.setExtraParams({
bouquet: 'dstv'
});
onlineStore.load();
},
painted: function() {
console.log('PAINTED ' + offlineStore.getCount());
}
}
});
}
})
Any help, greatly appreciated.