0
votes

I've a window. In that window i've one combobox witha store. I want to mask the window until the store completes loading data. This i can achieve by writing this.setLoading(true) in store before load and this.setLoading(false) in load.

But When i'm using above approach the mask is displaying after clikcing on the combo trigger. That means store is getting loading after clicking on the trigger. Instead of that i want to load the store while intializing the window

How can i achieve this?

2

2 Answers

1
votes

The easiest way would be to set the queryMode to 'local' and triggerAction to 'query'. This wan't even clear the store filters any more. But note that the beforequery event will still get fired, even if the query will abort.

Here a config example:

Ext.create('Ext.form.ComboBox', {
    fieldLabel: 'Choose',
    store: myStore,
    queryMode: 'local',
    triggerAction: 'query',
    displayField: 'name',
    valueField: 'id'
});
0
votes

It's normal behavior. When you clicking on the trigger - store is loading. You can cancel loading by handling beforeload store event. You can make something like:

var form = this.getForm();
var store = this.getStore();

store.load({ 
    callback: function(records, operation, success) {
        form.show();
    }
});

store.on('beforeload', function() {return false; })