Kanchan
Kanchan

Reputation: 1619

Refreshing Combo box data in extjs 4

Getting stuck on refreshing data of combo box in Extjs 4, on button click trying to reload combo data by reloading store -

Ext.StoreManager.lookup('test').load();

Store is reloading but data doesn't reflecting on combo box.

Is there any way?

 {
    xtype         : 'combo'
   ,fieldLabel    : 'Default Role'
   ,name          : 'org_default_role'
   ,store         : Ext.create('ASA.store.Roles')
   ,displayField  : 'role_rolename'
   ,valueField    : 'role_id'
   ,queryMode     : 'local'
   ,labelWidth    : 100
   ,width         : 241
   ,triggerAction : 'all'
}

Upvotes: 3

Views: 8629

Answers (3)

AlexN
AlexN

Reputation: 49

I had similar of this situations. Cause of this behavior is that load store event performing after Filtering of store, and ComboBox has old data. I added load event hendler on store of My combo and then apply filter.

 my_combo.store.on({
            load: function(store, records, successful, eOpts) {
                store.filterBy(function(record) {
                    return record.get('id') != 1 && record.get('id') != 12 && record.get('id') != 777;
                });
            }
        });

Upvotes: 1

toree
toree

Reputation: 437

I would try
your_combo.store.load();

Upvotes: 1

dougajmcdonald
dougajmcdonald

Reputation: 20037

Your store seems to be of type ASA.store.Roles but your store.load() is trying to find a store called 'test'.

If you change your lookup/load call to this:

Ext.StoreManager.lookup('ASA.store.Roles').load();

Does it help?

Upvotes: 0

Related Questions