Persisting session-specific data using SessionStorageProxy

So far in this chapter we have learned how to create a model, store it as a collection in a store, establish relationships and carry out the validations. However, all this was happening in memory. One page refresh and all our models will be re-initialized and stores re-constructed. It would be a lot better if we could persist them and use them for a longer interval. Persistence capability is provided to us by Proxy. Now let's see how to work with the specific proxies to load and save models. The following are types of proxies supported by Sencha Touch:

  • ClientProxy: Helps us to persist a model on the client browser and load it from that storage
  • MemoryProxy: Uses an in-memory storage
  • SessionStorageProxy ...

Get Sencha Touch Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.