22 Mar 2011 11:45 PM #1
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?
Any advice would be much appreciated. I've also posted this on Stack Overflow if you'd like to get some extra reputation points!
23 Mar 2011 1:06 AM #2
You should make an "Ext.Ajax.request()", in the success config you need to decode the json, after that you need to add the records to the store that you need.
I hope that helps.
23 Mar 2011 1:51 AM #3
This is a prime candidate for Ext.Direct. However it's not officially supported at the moment but is planned to be once Ext4 is out the door.
Check out these threads:
However, in the meantime crysfel's way is probably the best way to do it.Want to build better Sencha apps? Check out my free email course Best Practices for Improving your Sencha Apps
Learn Ext JS 6 with my new ebook - Ext JS 6: Getting Started. Get a Sample Chapter now!
Need help with Sencha development, code reviews or training? Get in touch!
By olin in forum Sencha Touch 1.x: DiscussionReplies: 10Last Post: 20 Jan 2012, 10:10 AM
By babar.sajjad in forum Sencha Touch 1.x: DiscussionReplies: 3Last Post: 23 Apr 2011, 6:54 AM
By tmanderson in forum Sencha Touch 1.x: DiscussionReplies: 4Last Post: 27 Mar 2011, 3:13 PM
By babar.sajjad in forum Sencha Touch 1.x: DiscussionReplies: 13Last Post: 24 Jan 2011, 6:40 AM