jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: DragDrop how to keep the item? DragDrop how to keep the item? #58234

    Stanoweb
    Participant

    Thanks.. I will try it..
    What I did was to save the source of the treeA into a temp variable and after adding the node to the treeB, set back the source to the treeA.
    Something like this, based on your code :
    $(‘#treeA’).jqxTree({ allowDrag: true, allowDrop: true, height: ‘300px’, width: ‘220px’,
    dragEnd: function (dragItem, dropItem, args, dropPosition, tree) {
    var tempSource= $(‘#treeA’).jqxTree(‘source’)
    switch (dropPosition) {
    case “inside”:
    $(‘#treeB’).jqxTree(‘addTo’, dragItem, dropItem);
    break;
    case “before”:
    $(‘#treeB’).jqxTree(‘addBefore’, dragItem, dropItem);
    break;
    case “after”:
    $(‘#treeB’).jqxTree(‘addAfter’, dragItem, dropItem);
    break;
    }
    $(‘#treeA’).jqxTree({source: tempSource});
    return true;
    }
    });

Viewing 1 post (of 1 total)