Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting the LocalStorageProxy working with a TreeStore
    primarykey
    data
    text
    <p>Hullo there,</p> <p>I am building a Sencha Touch iPhone app that utilises a TreeStore which works nicely with a NestedList but I've hit a wall.</p> <p>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.</p> <p>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 <code>app.stores.event_store.load();</code> the screen is blank and Console shows that the localStorage is empty with no errors.</p> <p>My model: </p> <pre> Ext.regModel('Events', { fields: [ {name: 'text', type: 'string'}, {name: 'info', type: 'string'}, {name: 'attend', type: 'boolean', defaultValue: 'false'} ] }); </pre> <p>My store:</p> <pre> 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(); </pre> <p>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.</p> <p>The full application can be found at <a href="http://github.com/fetimo/Schedlr" rel="nofollow">it's GitHub repo</a>.</p> <p>-fetimo</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload