【问题标题】:ExtJS - Add store to utility classExtJS - 将商店添加到实用程序类
【发布时间】:2021-11-17 18:13:45
【问题描述】:

我应该如何在 ExtJS 6.2.1 的实用程序类中使用商店?

在网格组件中可以这样做:

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

如果我在课堂上这样做:

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

那么store 只是一个字符串。

【问题讨论】:

  • 您使用哪个 ExtJS 版本和框架?

标签: javascript class extjs store


【解决方案1】:

你可以使用:

Ext.StoreManager.lookup(STORE_NAME)

【讨论】:

  • 或者Ext.getStore('STOREID');,如果你给了商店一个storeId。
猜你喜欢
  • 2013-05-16
  • 1970-01-01
  • 2022-12-24
  • 2020-03-02
  • 2014-09-29
  • 1970-01-01
  • 2012-06-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多