PDA

View Full Version : localstorage with TreeStore



Saemy
5 Sep 2011, 1:24 AM
Is it possible to make a localstorage for a TreeStore? I need this for nested List...

Any suggestions?

mitchellsimoens
6 Sep 2011, 6:02 AM
There is a proxy config to define a proxy. However, you can only define one... that's where the fun begins!

Saemy
6 Sep 2011, 6:30 AM
So it's not possible?

mitchellsimoens
6 Sep 2011, 6:34 AM
So it's not possible?

Should be possible... You just need to figure out how to do the online/offline syncing.

Saemy
6 Sep 2011, 6:37 AM
Ok I understand... but is not as easy as with a localstorage proxy in "Ext.Data.Store".

the problem is, that i don't know how to fill a localstore of a TreeStore with data. :-?

mitchellsimoens
6 Sep 2011, 6:41 AM
It's easy to set the proxy to use the localstorageproxy but the difficulty is the syncing between online and offline data. Like first time you go to the app, will you have data in the localstorage of that device? Probably not.

dobie_
22 Sep 2011, 5:21 PM
It's easy to set the proxy to use the localstorageproxy but the difficulty is the syncing between online and offline data. Like first time you go to the app, will you have data in the localstorage of that device? Probably not.

I don't understand how online/offline syncing would be different from a normal Store. Could you clarify?

dobie_
22 Sep 2011, 5:30 PM
I'm having a problem where I have a TreeStore that's configured to use the localstorage proxy. When I sync() the TreeStore the data in Local Storage is still empty.

EDIT: Here's some elaboration on this issue: http://www.sencha.com/forum/showthread.php?135084-Getting-the-LocalStorageProxy-working-with-a-TreeStore

dobie_
26 Sep 2011, 2:40 PM
For anyone requiring this functionality -- the only way I can think of is to stringify the TreeStore data, which is a bit of a challenge:
http://stackoverflow.com/questions/7523672/converting-an-ext-data-treestore-to-json (http://stackoverflow.com/questions/7523672/converting-an-ext-data-treestore-to-json)

MiamiCoder
28 Sep 2011, 2:01 PM
I agree with dobie_. Had similar problem a few days ago. Ended up rolling out my on localstorage routine using serialized store data.

dobie_
28 Sep 2011, 2:04 PM
I agree with dobie_. Had similar problem a few days ago. Ended up rolling out my on localstorage routine using serialized store data.

At this point I'm waiting for Sencha Touch 2.0 to come out. I really don't want to roll my own cause the raw TreeStore structure looks complicated...

If you've already solved the problem, though.. maybe you could put it on github and we could make it a sencha touch extension!

ben.gillis
8 Nov 2011, 8:54 PM
...