Getting loaded storage in extjs4

I get null while trying to get loaded storage from the controller. The load is also successful. I checked it out.

I have a store as follows.

Ext.define('GridApp.store.schemedatastore',{
    extend: 'Ext.data.Store',
    model: 'GridApp.model.schemedatamodel',
    autoLoad: true,
    alias: 'store.schemedata',
    storeId: 'schemedatastoreid',
    constructor:function(){
        console.log('Calling parent');
        this.callParent(arguments);
        },
    listeners: {
        load:function(store,records,isSuccessful){
            if(isSuccessful){
                console.log('Load successful');
            }
            console.log(records[0].get('name'));
            console.log('scheme Data store loaded too.');
        },
    }
});

In my controller, I added:

stores: ['schemesstore',
             'schemedatastore'],

I tried to access these paths in the controller,

Ext.getStore('schemedatastoreid');which returns null and this.getschemedatastoreStore();which says it is an undefined function in the controller.

Am I missing something here?

+3
source share
1 answer

Try any of these steps:

this.getSchemedatastoreStore()

// the non-alias version of getStore    
Ext.StoreManager.lookup('schemedatastoreid') 

// in case MVC behavior overrides your storeId config
Ext.StoreManager.lookup('schemedatastore') 

The MVC template automatically assigns your store the class name of the store as the store identifier if you do not define your own.

, storeId: 'schemedatastoreid', storeId schemedatastore. MVC storeId config, , -. , getStore.

+5

All Articles