简体   繁体   中英

How to load data to multiple stores with one request in Sencha Touch?

I'm developing a Sencha Touch application that has multiple data stores. In order to improve performance, I would like to load the data to these stores in a single HTTP request.

For this to work, the server would output different JSON root elements, one for each store. How can this be done in Sencha Touch?

This question may also be useful for Ext JS developers, as I believe Ext JS is using the same data stores as Sencha Touch.

Any advice would be much appreciated.

Its possible! You will have to use an Ajax request to pull all the store data once. Then separate them on the client side and load appropriate data to the stores. You can make use of MemoryProxy class here.

Remember that you will not set a httpProxy to the stores. And data will be loaded to each store using the loadData method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM