Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8082659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:11:28+00:00 2026-06-05T17:11:28+00:00

I have a set of combo boxes that are driven by five stores and

  • 0

I have a set of combo boxes that are driven by five stores and I want to fire a function once all the stores are completely loaded. What is the recommended way of doing this? I could do something like this but it feels kludgy:

var store1Loaded = false;
var store2Loaded = false;

store1.on('load', function(){
    store1Loaded = true;
});

store2.on('load', function(){
    store2Loaded = true;
});


store1.load();
store2.load();

function WaitForFunction()
{
    if (!store1Loaded || !store2Loaded)) {
       setTimeout( WaitForFunction, 100);
       return;
    }
    AllStoresLoaded();
}

function AllStoresLoaded(){
      //Do Something
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:11:29+00:00Added an answer on June 5, 2026 at 5:11 pm

    Use the store.isLoading() method, I think that is what it is for. I use it and it works fine.

    1. Configure the stores that you want to be loaded before performing
      some logic with a storeId config.

    2. Put these storeIds into an array.

    3. Whenever one of these stores is loaded iterate through the array, lookup the store with Ext.getStore and call isLoading on it.

    4. If none of the stores in the array are still loading, perform your logic.

    For example, say I want store1 and store2 loaded before I perform some logic (I am showing this in non-MVC pattern because it looks like you are not using MVC pattern from your snippet).

    var store1 = Ext.create('Ext.data.Store', {
        model: myModel,
        storeId: 'store1', // store needs to be done MVC style or have this config
        proxy: {
            type: 'ajax', 
            url: 'url...',
            reader: 'json'
        },
        autoLoad: {
            callback: initData // do this function when it loads
        }
    });
    
    var store2 = Ext.create('Ext.data.Store', {
        model: myModel,
        storeId: 'store2',
        proxy: {
            type: 'ajax', 
            url: 'url...',
            reader: 'json'
        },
        autoLoad: {
            callback: initData // do this function when it loads
        }
    });
    
    // the stores to be checked
    var myComboStores = ['store1', 'store2']
    
    // function does logic if they are both finished loading
    function initData() {
        var loaded = true;
        Ext.each(myComboStores, function(storeId) {
            var store = Ext.getStore(storeId);
            if (store.isLoading()) {
                loaded = false;
            }
        });
        if(loaded) {
            // do stuff with the data
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some combo-boxes that are set up as drop down lists, and the
I have a set of three combo boxes (drop downs) that are populated by
I have an application which is using a set of three combo boxes. I
I have created a WinForms user control that is a set of five cascading
I have 3 dropdown boxes (combo box) in asp.net environment. They are all optional,
I'm trying to set multiple combo boxes to all having the same set of
I have a custom control that has several text boxes and combo boxes in
I have a window form that has a couple of combo boxes. What I
I have multiple combo and option boxes whose visibility is set true or false
I have set up multiple targets in a single xml file. I expect all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.