ExtJs:一起使用treeviewdragdrop和gridviewdragdrop

时间:2014-06-19 13:53:42

标签: extjs drag-and-drop treeview extjs4.1 treegrid

我想使用ExtJs 4.1.1的集成两个Drag n Drop功能

我想将节点从树面板/网格拖动到另一个树网格中。 拖放功能应具有TreeViewDragDrop的灵活性,其中我可以将节点放入任何父节点。深度应该很重要。

但由于我需要以TreeGrid格式显示我的数据,因此我必须使用GridViewDragDrop

由于源和目的地之间的这种不匹配,我无法得到两者所需的功能。

Here is a JSFiddle for this: 

http://jsfiddle.net/ATechieDiary/6Ad6b/2/

请帮忙。

1 个答案:

答案 0 :(得分:1)

将两个ptypes更改为' gridviewdragdrop'并在插件监听器中手动处理深度' beforedrop'在viewConfig中。

viewConfig: {
    plugins: {
        ptype: 'gridviewdragdrop',
        dragText: 'Drag and drop to reorganize'
    },
    listeners: {
        beforedrop: function(node, data, overModel, dropPosition, dropHandlers) {

        //handle depth manually here

        }
    }
},