1. #1
    Ext User
    Join Date
    Oct 2009
    Posts
    9
    Vote Rating
    0
    Sujan is on a distinguished road

      0  

    Default 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

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,641
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Ext User
    Join Date
    Oct 2009
    Posts
    9
    Vote Rating
    0
    Sujan is on a distinguished road

      0  

    Default


    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

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,169
    Vote Rating
    28
    jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough

      0  

    Default


    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.