Javascript extjs存储代理未为xtype调用

Javascript extjs存储代理未为xtype调用,javascript,extjs,extjs5,Javascript,Extjs,Extjs5,我有一个弹出窗口,其中有一些xtype,其中一个xtype是一个网格,它有一个存储,但我没有看到它调用任何ajax调用。有人能告诉我我错过了什么吗 Ext.define('myApp.view.myPopup' {... .... { xtype: 'grid', store: 'MyStore', iconCls: 'x-fa fa-users', height : 450,

我有一个弹出窗口,其中有一些xtype,其中一个xtype是一个网格,它有一个存储,但我没有看到它调用任何ajax调用。有人能告诉我我错过了什么吗

Ext.define('myApp.view.myPopup' {...
....
{
            xtype: 'grid',
            store: 'MyStore',
            iconCls: 'x-fa fa-users',
            height : 450,
            columns: [{
                header...

...}
贮藏


您有一个输入错误:
自动加载
->
自动加载

您的代码也不会显示正在创建的存储的实例
store:'MyStore'
需要一个具有
storeId:'MyStore'
的现有存储实例

您可能想要更像:

Ext.define('myApp.view.myPopup' {...
....
{
            xtype: 'grid',
            store: { type: 'myStore' },
            iconCls: 'x-fa fa-users',
            height : 450,
            columns: [{
                header...

...}

Ext.define('myApp.store.MyStore', {
    extend: 'Ext.data.Store', 
    alias: 'store.myStore',
    model: 'myApp.model.modelA',
    // ....
});

创建store的实例并指向它

 var store = Ext.create('myApp.store.MyStore' {
                autoLoad : true,        
            });
..........

    {       xtype: 'grid',
            store: store,
            iconCls: 'x-fa fa-users',
            height : 450,

    }

就像@evan trimboli所说的,你要么使用一个激励存储实例,要么使用一个配置。然后,该配置将导致为您创建一个新的存储实例

要使用配置动态创建存储实例,您需要在存储类上提供别名,例如
别名:“store.mystore”
。 现在,您可以在网格类的存储配置中引用它,如
store:{type:'myStore'}

请将所有内容放在下面,并参见


埃文商店:{type:'myStore'}这就像一个符咒。非常感谢。前端的网格可见吗?你能做一把显示问题的小提琴吗?
 var store = Ext.create('myApp.store.MyStore' {
                autoLoad : true,        
            });
..........

    {       xtype: 'grid',
            store: store,
            iconCls: 'x-fa fa-users',
            height : 450,

    }
Ext.define('myApp.store.MyStore', {
    extend: 'Ext.data.Store',
    alias: 'store.mystore',  // the alias we need for the store config of the grid
    // ...
});

Ext.define('myApp.view.myPopup', {
    extend: 'Ext.grid.Panel',
    store: {
        type: 'mystore' // references the store by it's alias
    },
    // ...
};