PDA

View Full Version : Sencha Touch 2 example of syncing localStorage store with remote JSONP proxy store



lalexgraham
12 Sep 2012, 1:42 PM
My blog post (http://lalexgraham.wordpress.com/2012/09/12/sencha-touch-2-example-of-syncing-localstorage-store-with-remote-jsonp-proxy-store/) describes a quick and simple way to sync localStorage with data coming from a remote source. Would like to hear any feedback on this.

Thanks

mitchellsimoens
16 Sep 2012, 3:54 PM
You need to get a syntax plugin for your blog so that your code can have syntax highlighting but more importantly for indention.

lalexgraham
17 Sep 2012, 1:03 PM
Thanks for the feedback. I've finally found out how to do this with a wordpress.com site. Post is looking better now. Cheers

heisenburger
27 Nov 2013, 11:16 AM
My blog post (http://lalexgraham.wordpress.com/2012/09/12/sencha-touch-2-example-of-syncing-localstorage-store-with-remote-jsonp-proxy-store/) describes a quick and simple way to sync localStorage with data coming from a remote source. Would like to hear any feedback on this.
Great post! Previously I had been attempting to do this just keeping the store's Records organized in memory by assigning the Store's records to an instance variable during the beforeload and then trying to merge them at load. However, when load is fired it has already loaded all of the new records into the Store.

So, trying to pu the old Records stored in the instance variable would cause refreshing to occur twice because I was add-ing at least some of the "old" store records back in after the new results of "load" and then therefore trigger events after the "load" when I did the "add".

So, two Stores definitely seems appropriate in this case, from my recent personal experience :)

joshmorony
16 Jan 2014, 6:07 AM
I remember trying to figure out how to do this a while ago and couldn't seem to find much on the topic - a much needed blog post!