Problem with Drag Drop ExtJs

2

I get the following error when I drag a "file" to another "folder" in tree TypeError: b is null or TypeError: a is null . Here is my two tree 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');
        }
    }]

});
    
asked by anonymous 17.06.2014 / 13:22

1 answer

1

In the viewconfig configuration, ddgroup is not missing?

Example:

viewConfig : {
                plugins : {
                    ptype : 'treeviewdragdrop',
                    ddGroup : 'groupx',
                    containerScroll : true,
                    expandDelay : 1000
                }
            }

What should appear in the two trees so that Extjs can identify between which components drag an drop will occur. Try to follow this example.

I hope I have helped

    
13.08.2014 / 22:22