30 Mar 2010 6:17 AM #1
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?
30 Mar 2010 8:41 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
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 Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is 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.
14 Apr 2010 7:42 AM #4