Eleanor
Eleanor

Reputation: 357

Tree drag drop with copy or move icon

I have a tree, with dragdrop.

enableDD: true,
ddAppendOnly: true,

And I can copy or move nodes by pressing spec key on keyboard.

this.on('beforenodedrop', function (e) {
    e.tree.dragZone.proxy.animRepair = false;
    // copy mode icon TODO
    this.moveNodes(e.target, e.dropNode, null, null, e.rawEvent.ctrlKey || e.rawEvent.altKey || e.rawEvent.shiftKey);
    return false;
});

But I'm searching for a solution for change that lovely x-dd-drop-ok-add and/or drop-add.gif to an other on move (minus instead of plus).

Have you any idea for that? Can you help me?

Upvotes: 0

Views: 762

Answers (1)

Saket Patel
Saket Patel

Reputation: 6683

i haven't checked this works or not but you can check that nodedragover event will be fired whenever a node is dragged on another node so at that time instead of displaying default icon you can specify your custom icon, along this lines you can debug and make some additional changes if required

treePanel.on('nodedragover', function(dragOverEvent){
     e.source.proxy.el.replaceClass('x-tree-drop-ok-append', 'x-tree-drop-ok-append-minus');
});

Upvotes: 2

Related Questions