TreePanel: Store is not loading

560 Views Asked by At

It's my first time working with ExtJS 6, and i'm having some problems with a TreePanel... Here are my scripts:

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
        }
    }
},

});

And 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'}
]

});

I can see the tree root in my panel, but my store is not loading... If I check network, nobody is calling to listadoCausasTipoAdminTree action...

Can you help me? Thanks

P.S. Srry for my english...

Update: When I execute Ext.getCmp('treepanelCausa').store.proxy.type I get "memory" in console, and Ext.getCmp('treepanelCausa').store.proxy.url Is undefined...

0

There are 0 best solutions below