Search code examples
javascriptclassextjsstore

ExtJS - Add store to utility class


How should I use a store in a utility class in ExtJS 6.2.1?

In Grid components one can just do:

Ext.define('App.MyGrid', {
   extend : 'Ext.grid.Grid',
   store  : 'myStore',
});

If I do this in my class:

Ext.define('App.MyClass', {
   singleton : true,
   store     : 'myStore',
});

then store is just a string.


Solution

  • You can use:

    Ext.StoreManager.lookup(STORE_NAME)