javascript - ExtJS - 将商店添加到实用程序类
问题描述
我应该如何在 ExtJS 6.2.1 的实用程序类中使用商店?
在 Grid 组件中,您可以这样做:
Ext.define('App.MyGrid', {
extend : 'Ext.grid.Grid',
store : 'myStore',
});
如果我在课堂上这样做:
Ext.define('App.MyClass', {
singleton : true,
store : 'myStore',
});
thenstore
只是一个字符串。
解决方案
您可以使用:
Ext.StoreManager.lookup(STORE_NAME)
推荐阅读
- sql - SQL 舍入到小数点后 2 位或 3 位
- python - Mendeley API - Python SDK - 可以更改文档的详细信息吗?
- javascript - 电子“最小化”
- android - Android Webview - Apple Music iframe 无法加载
- node.js - 当用户单击图像时,我想重定向到另一个页面
- here-api - 使用 HERE api 编码具有多个方向但只有一个匹配方向的车道信息
- r - 将中值、iqr 等给定值转换为箱线图
- wordpress - Woocommerce 可变产品:对不起,该产品不可用。请选择不同的组合
- rest - 无法查询 JavaScript REST API
- reactjs - 使用 firebase-messaging-sw.js 在 BackgroundMessageHandler ReactApp 中同步数据