-
30 Mar 2010 6:17 AM #1
Combine requests for multiple panels?
Combine requests for multiple panels?
I have a nice intranet application that uses lots of FormPanels:

(Sorry for all the grey bars, cencoring all the "secret" information
)
Each panel gets it data by doing a HTTP request when it's loaded, so my Firebug looks something like this:

I probably don't have to tell you this is not very nice on the server and gets quite slow if there are many tabs opened at once.
Is there any way to combine these requests somehow?
Right now the loading of the form is done in its initComponent(), but I thought about it just adding values to an array and creating another function to do a request and populate the form - but I have no idea if this is the right way or if there are better ones.
So perhaps even any examples of how to optimize the loading of many panels?
- Sujan
-
30 Mar 2010 8:41 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
I'm not sure if it's the best way but what I've done is create a master Ext.data.Store (or whichever store) and then add a listener for the the load event. Once it loads, I can create separate stores for whatever I need.
When you are returning the data for the master store, just create an array with a separate key which holds an array or whatever you need for the separate stores.
Make any sense?Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
11 Apr 2010 3:33 AM #3
Thanks Mitchell, this makes sense.
I was hoping for a somewhat automated way, perhaps a "pool store" where you collect the data you want to request and it is done with one request to the server or something. But as this is a really specific request, I understand that this probably doesn't exist.
I'll see if it is necessary at all.
- Sujan
-
14 Apr 2010 7:42 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
or you can do ONE ajax request and fill in the data accordingly.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.


Reply With Quote