开发者

Sencha Touch Remote and Local Storage Combined

开发者 https://www.devze.com 2023-04-06 22:57 出处:网络
I am trying to learn Sencha Touch and am working on an app which is helping me a lot to learn it. I have a situation where there is a News tab and it retur开发者_如何学Cns news from RSS using proxy of

I am trying to learn Sencha Touch and am working on an app which is helping me a lot to learn it. I have a situation where there is a News tab and it retur开发者_如何学Cns news from RSS using proxy of XML datatype. It works so far.

I am loading those RSS at the tab activate event and there is a progress bar also shown which blocks the UI while it's retrieving news. Now assume if there is no internet and the loader will load indefinitely.

How can I make my app use Remote as well as Local storage to show those news. I mean bind List control to Local storage but update Local storage with Remote call in background? I know how to bind List control to Local storage but how can I update Local storage in background with Remote call to the URL in background on List activate listener?


You can use 'setProxy' method of the store object to change it from local to ajax. Also you can load the data in the background and then add each item to the store with it's add method.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号