Problem with Drag Drop Extjs

Asked

Viewed 102 times

2

Returns me the following error when I drag a "file" to another "folder" in Tree TypeError: b is null or TypeError: a is null. Follow my two-word code :

Ext.require(['Ext.tree.plugin.TreeViewDragDrop']);

var storeProc = Ext.create('Ext.data.TreeStore', {
    root: {
        children: [{
            id: 'src',
            text: "Processo1(4)",
            expanded: false,
            children: [{
                text: 'Intimacoes(2)',
                expanded: false,
                children: [{
                    text: 'ArquivoIntimacao1',
                    leaf: true,
                },
                {
                    text: 'ArquivoIntimacao2',
                    leaf: true,
                    cls: 'file'
                }]
            },{
                text: 'Manifestacoes(2)',
                expanded: false,
                children: [{
                    text: 'ArquivoManifestacao1',
                    leaf: true,
                },{
                    text: 'ArquivoManifestacao2',
                    leaf: true,
                }]
            }]
        },{
            text: 'Processo2(0)',
            expanded: false
        }]
    },
    folderSort: true,
    sorters: [{
        property: 'text',
        direction: 'ASC'
    }]
});

var storeArq = Ext.create('Ext.data.TreeStore', {
    root: {
        children: [{
            id: 'src',
            text: 'Arquivos(4)',
            expanded: false,
            children: [{
                text: "Intimacao0",
                leaf: true,
            },{
                text: 'Intimacao1',
                leaf: true,
            },{
                text: 'ArquivoIntimacao1',
                leaf: true,
            },
            {
                text: 'ArquivoIntimacao2',
                leaf: true,
            }]
        }]
    },
    folderSort: true,
    sorters: [{
        property: 'text',
        direction: 'ASC'
    }]
});


Ext.define('Procuradoria.view.menuPrincipal.Processos', {
    extend: 'Ext.panel.Panel',
    requires: ['Ext.layout.container.HBox'],

    title: 'Teste',
    layout: 'hbox',
    width: '100%',
    frame: true,
    items: [{
        id: 'tree',
        xtype: 'treepanel',
        title: 'Arquivos',
        width: '50%',
        border: 0,
        margin: '10 0 0 1%',
        rootVisible: false,
        itemId: 'arq-proc',
        useArrows: true,
        collapsible: false,
        collapseFirst: false,
        collapsed: false,
        hideHeaders: true,
        store: storeArq,
        viewConfig: {
            plugins: {
                ptype: 'treeviewdragdrop',
                appendOnly: true
            }
        }
    },{
        id: 'tree2',
        xtype: 'treepanel',
        title: 'Processos',
        width: '49.9%',
        border: 0,
        margin: '10 1% 0 1%',
        rootVisible: false,
        itemId: 'proc-proc',
        useArrows: true,
        collapsible: false,
        collapseFirst: false,
        collapsed: false,
        hideHeaders: true,
        store: storeProc,
        viewConfig: {
            plugins: {
                ptype: 'treeviewdragdrop',
                appendOnly: true
            }
        }
    }],
    tbar: [{
        id: 'bt-novo-proc',
        xtype: 'button',
        cls: 'x-btn-text-icon',
        icon: imageSource('page_add.png'),
        text: 'Novo',
        handler: function(){
            alert('novo');
        }
    }]

});

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.