Home > Enterprise >  ExtJS - Add store to utility class
ExtJS - Add store to utility class

Time:09-28

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.

CodePudding user response:

You can use:

Ext.StoreManager.lookup(STORE_NAME)
  • Related