jQuery EasyUI Tree Menu - Tree Menu Drag-and-Drop Control
When using the Tree plugin in an application, drag and drop functionality allows users to change node positions. To enable drag and drop operations, all you need to do is set the Tree plugin's 'dnd' property to true.
Creating a Tree Menu
$('#tt').tree({
dnd: true,
url: 'tree_data.json'
});
When a drop operation occurs on a tree node, the 'onDrop' event will be triggered, and you should do one or more things, such as saving the node state to a remote server, and so on.
onDrop: function(targetNode, source, point){
var targetId = $(target).tree('getNode', targetNode).id;
$.ajax({
url: '...',
type: 'post',
dataType: 'json',
data: {
id: source.id,
targetId: targetId,
point: point
}
});
}