In DOJO DND, How do I copy (not move) a node between 2 sources

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rythmic
    New Member
    • Feb 2010
    • 29

    In DOJO DND, How do I copy (not move) a node between 2 sources

    Hi!

    So basically what I'm trying to do is overwrite onDropExternal handler for a dnd.Source object.

    I tried the brutal way of using this.inserNodes but it moved the node from the original source even though the original source has copyOnly set to true.

    So how do I copy this node nicely onExternalDrop

    here is my thinking

    Code:
    tgtContainer1.onDropExternal = function(source,nodes,copy) {
                        
       var nodeCount = nodes.length;
        
       //foreach node copy or move depending on copy state
       for(i = 0; i < nodeCount; i++) {                    
            if (!copy)
               // Move the object
                        
            }
            else {
                // Copy the object - perhaps by adding and deleting?
            }
        }
        });
    Thank you in advance.

    // Rythmic
Working...