johnny
johnny

Reputation: 53

fancytree drag and drop - get current element

I activated drag and drop in fancytree

this is how it looks like:

dragDrop: function(node, data) {
    var level = node.getLevel();
    node.parent.setExpanded(true);

    console.log(node);
    if(level < 4){
        data.otherNode.moveTo(node, data.hitMode);
    }
}

how can i get the current element with jquery?

Upvotes: 0

Views: 729

Answers (1)

Alexander Kokh
Alexander Kokh

Reputation: 11

I use this code:

            dragDrop: function (node, data) {
                data.otherNode.moveTo(node, data.hitMode);
                $.ajax({
                    url: '<?php echo Yii::app()->createUrl("phonebook/orgmove"); ?>',
                    type: 'POST',
                    data: {destination: data.node.key, node: data.otherNode.key },
                    dataType: 'json'
                });
            }

Upvotes: 1

Related Questions