PDA

View Full Version : Sencha touch localstorage



ssdesign
7 Jul 2010, 6:41 AM
Hi,
Pardon my ignorance, but can someone please tell me where should I look for if I want to learn about localstorage and sencha touch integration?

I have seen lots of posts about Json and Store but I am not sure if I can create local database using store and if that is the right way to do it.

Thanks a lot.

evant
7 Jul 2010, 6:46 AM
The solitaire example uses LocalStorage to store the game state, you could check that out.

tubamanu
7 Jul 2010, 6:47 AM
hi,

i've read something about local storage in this blog

http://www.nils-dehl.de/2010/06/how-to-make-a-sencha-touch-app-offline-usable-with-the-html5-cache-manifest/

ssdesign
7 Jul 2010, 7:24 AM
Hi,
Thanks for your replies.

I have been struggling for a while to understand the complex code of Solitaire game.

Digging the code i found:


this.gameStore = new Ext.data.Store({
proxy: new Ext.data.LocalStorageProxy({
id: 'solitaire-games'
}),
model: 'Game',
autoLoad: false,

Does this mean that "Store" and "Model" are still key to Localstorage?

Thanks

TommyMaintz
7 Jul 2010, 9:30 AM
Yeah, the way we interact with localstorage is through a proxy. So you still define your models, set up your store, but then synchronize with localstorage through a proxy.