HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
When the tree (Tree) plug-in an application, drag and drop (drag) and place (drop) functional requirements allow users to change the position of the nodes. Enable drag (drag) and place (drop) operation, all you need to do is put the tree (Tree) widget 'dnd' property is set to true.
$ ( '# Tt'). Tree ({ dnd: true, url: 'tree_data.json' });
When an operation is placed on a tree node, 'onDrop' event will be triggered, or you should do some more operations, such as saving the state of the node to the remote server, and so on.
onDrop: function (targetNode, source, point) { var targetId = $ (target) .tree ( 'getNode', targetNode) .id; $ .ajax ({ url: '/en.', type: 'post', dataType: 'json', data: { id: source.id, targetId: targetId, point: point } }); }