【问题标题】:Store subclass does not work in extjs存储子类在 extjs 中不起作用
【发布时间】:2016-07-14 17:49:57
【问题描述】:

我已经创建了一个类似

的类
 Ext.define('abc.StoreService', {
     extend: 'Ext.data.Store',
     autoLoad: true,
     autoSync: true,
     proxy: {
         type: 'memory',
         reader: 'json',
         data: [{
             date: "2016-07-15",
             arrival: 'Foo',
             dep: 'abc'
         }]
     },
}

 Ext.define('abc.mystore.Store', {
     extend: 'abc.StoreService',
     alias: 'Abc Store',
    }); 

但如果我在网格中使用

store: 'abc.mystore.Store',

或使用

store: 'Abc Store',

它不加载存储数据。我做错了什么吗?

【问题讨论】:

    标签: extjs6 extjs6-classic extjs-stores


    【解决方案1】:

    您没有分配商店 ID,也没有向 StoreManager 注册商店。

    Ext.grid.Panel 中的 'store' 参数接受一个商店实例(您可以通过 Ext.create('abc.mystore.Store') 来创建它,或者是在 StoreManager 中注册的商店的 id。

    【讨论】:

      猜你喜欢
      • 2016-10-10
      • 1970-01-01
      • 2012-03-02
      • 1970-01-01
      • 1970-01-01
      • 2020-10-03
      • 1970-01-01
      • 2018-05-26
      • 2019-03-16
      相关资源
      最近更新 更多