Hullo there,
I am building a Sencha Touch iPhone app that utilises a TreeStore which works nicely with a NestedList but I've hit a wall.
It needs a way to read data in a static store (the TreeStore), load it into localStorage so it's writable and then save some user preferences. I've figured out that the localStorageProxy is most likely what I need (I was relieved to discover I didn't have to serialise and deserialise the JSON store manually!) but after reading the documentation on it and trying and failing a few things I'm at a loss.
As it stands, it generates the localStorage… storage but it's empty, this I guess is because I haven't loaded anything into it but on doing app.stores.event_store.load();
the screen is blank and Console shows that the localStorage is empty with no errors.
My model:
Ext.regModel('Events', { fields: [ {name: 'text', type: 'string'}, {name: 'info', type: 'string'}, {name: 'attend', type: 'boolean', defaultValue: 'false'} ] });
My store:
app.stores.event_store = new Ext.data.TreeStore({ model: 'Events', root: data, storeId: 'eventStoreId', proxy: { type: 'localstorage', id: 'eventsAttending', url: 'store.js', reader: { type: 'tree', root: 'items' } } }); app.stores.event_store.load();
It probably stems from a lack of a fundamental understanding of how these models and stores interact but if anyone could help, good karma will be sent your way.
The full application can be found at it's GitHub repo.
-fetimo