TreePanel:商店未加载

时间:2017-04-19 12:29:11

标签: javascript store extjs6 treepanel

这是我第一次使用ExtJS 6,我遇到了TreePanel的一些问题......这是我的脚本:

TipoCausasTree.js

Ext.define('Incidencias.view.main.TipoCausasTree',
{
    extend: 'Ext.tree.Panel',
    xtype: 'tipoCausasTree',
    alias: 'tipoCausasTree',
    reference: 'tipo-causas-tree',

    requires: [
        'Incidencias.view.main.TipoCausasController',
        'Incidencias.store.TipoCausasTreeStore',
        'Ext.data.*',
        'Ext.grid.*',
        'Ext.tip.*',
        'Ext.tree.*'
    ],

    store: {
        type: 'TipoCausasTreeStore'
    },

    controller: 'tipoCausas',

    id: 'treepanelCausa',
    displayField: 'text',

    loadMask: true,

    collapsed: false,
    animate: false,

    renderTo: Ext.getBody(),

    root: {
        nodeType: 'async',
        text: "Tipos De Causas",
        id: 'root',
        expanded: true
    },

    listeners: {
        contextmenu: 'onCtxMenu'
    }
});

TipoCausasTreeStore.js

Ext.define('Incidencias.store.TipoCausasTreeStore', {
extend: 'Ext.data.TreeStore',

alias: 'store.TipoCausasTreeStore',

requires: [
    'Incidencias.model.TipoCausasModel'
],

model: 'Incidencias.model.TipoCausasModel',
autoLoad: true,

lazyFill: true,

proxy: {
    type: 'ajax',
    url: context + 'listadoCausasTipoAdminTree.action',
    reader: {
        type: 'json',
        root: function(o) {
            return o.data || o.children
        }
    }
},

});

和TipoCausasModel.js

Ext.define('Incidencias.model.TipoCausasModel', {
extend: 'Ext.data.Model',

fields : [
    {name:'id', type:'string'},
    {name:'text', type:'string'},
    {name:'iconCls', type:'string'},
    {name:'cls', type:'string'}
]

});

我可以在我的面板中看到树根,但是我的商店没有加载...如果我检查网络,没有人调用listadoCausasTipoAdminTree动作......

你能帮帮我吗?感谢

P.S。我的英语是... ...

更新:当我执行时 Ext.getCmp( 'treepanelCausa')。store.proxy.type 我在控制台中获得“记忆”,并且 Ext.getCmp( 'treepanelCausa')。store.proxy.url 未定义......

0 个答案:

没有答案