1. #1
    Sencha Premium Member
    Join Date
    Dec 2009
    Posts
    19
    Vote Rating
    1
    mdb is on a distinguished road

      0  

    Default Problem with loading multiple datastores

    Problem with loading multiple datastores


    Hi,

    I have got a problem and can't figure out how to solve it. When I load a few datastores, it often happens that not all of them are loaded.

    First I thought that something was wrong with my code, but I don't think that's the problem after setting up a test page. I don't load the same data three times of course(but different datastores with different data), but I use this for testing. This is the code:
    <html>
    <head>
    <title>Testpage</title>
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
    <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="extjs/ext-all.js"></script>
    <script type="text/javascript" src="extjs/src/locale/ext-lang-nl.js"></script>
    <script type="text/javascript">
    Ext.onReady(function(){
    Ext.QuickTips.init();
    Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

    var dataUsers = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({
    url: 'php/data/data.php?type=users'
    }),
    autoLoad: true,

    reader: new Ext.data.JsonReader({
    root: 'results',
    totalProperty: 'total',
    id: 'id'
    }, [
    {name: 'id', mapping: 'id'},
    {name: 'username', mapping: 'username'}
    ])
    });
    var dataUsers2 = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({
    url: 'php/data/data.php?type=users'
    }),
    autoLoad: true,

    reader: new Ext.data.JsonReader({
    root: 'results',
    totalProperty: 'total',
    id: 'id'
    }, [
    {name: 'id', mapping: 'id'},
    {name: 'username', mapping: 'username'}
    ])
    });
    var dataUsers3 = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({
    url: 'php/data/data.php?type=users'
    }),
    autoLoad: true,

    reader: new Ext.data.JsonReader({
    root: 'results',
    totalProperty: 'total',
    id: 'id'
    }, [
    {name: 'id', mapping: 'id'},
    {name: 'username', mapping: 'username'}
    ])
    });

    });
    </script>
    </head>
    <body>
    </body>
    </html>
    This is what data/data.php?type=users returns to the datastores:
    ({"total":"7","results":[{"id":"16","username":"Username 1"},{"id":"12","username":"Username 2"},{"id":"11","username":"Username 3"},{"id":"10","username":"Username 4"},{"id":"1","username":"Username 5"},{"id":"8","username":"Username 6"},{"id":"9","username":"Username 7"}]})
    When I open the testpage, sometimes the datastores are loaded as usual, but after refreshing it stops loading it. The stores try to load for a long time and firebug-console label the GET requests sometimes as 'aborted'.

    What am I doing wrong? Isn't it possible to load a few datastores together at the same time?

    Thanks in advance for your help!

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    97
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Some servers only allow a maximum number of connections.

    Doing many requests is bad design anyway. Make a single request and use the data to load several stores.

Similar Threads

  1. creating window, with multiple datastores/TabPanels
    By CuTeBoi in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 10 May 2008, 7:22 PM
  2. Multiple store loading problem
    By deanoj in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 28 Apr 2008, 2:14 AM
  3. Aggregating Multiple Datastores
    By yitzer in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 9 Jan 2008, 12:44 PM
  4. [Solved]Multiple datastores stop load - use DWRProxy
    By fangzhouxing in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 13 Jul 2007, 7:36 PM
  5. Update multiple DataStores in one XHR request?
    By Wolfgang in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 11 Apr 2007, 10:41 AM

Thread Participants: 1