I'm trying to build a store with elements from localStorage in my Sencha Touch application.
The localStorage I want to get data from is localStorage["feeds"] and looks like this:
"[{"title":"Title 1","url":"http://stackoverflow.com"},
{"title":"Title2","url":"http://google.com"}]"
I'm trying to get it into the store with the following:
var feedsPanel;
var store;
Ext.setup({
icon: 'icon.png',
glossOnIcon: false,
onReady: function(){
Ext.regModel("feedModel", {
fields: [
{ name: "title", type: "string" },
{name: "url", type:"string"}
]
});
store = new Ext.data.Store({
proxy: new Ext.data.LocalStorageProxy({
id: 'feeds'
}),
model:"feedModel"
});
When I in Chrome try store.load(), this fails because of TypeError: Cannot read property 'title' of null.
How am I supposed to access every title and every url from this localStorage?
Looking at the example of the Solitaire game just makes me dizzy.
The rest of my Sencha application does not rely on this store as of now, and loads perfectly. I check if there are items in the store with the Console in Chrome.