问题
I am using JSTree with ASP.net. The html generated for the tree looks like
<ul>
<li ID="Manager1"><a href="#">node 1</a></li>
<li ID="Manager2"><a href="#">node 2</a></li>
<li ID="Employee1"><a href="#">node 3</a></li>
<li ID="Employee2"><a href="#">node 4</a></li>
<li ID="Employee3"><a href="#">node 5</a></li>
</ul>
When I Drag a node and drop on the other the function written for drag_finish is not getting called. The dnd plgin is used as below,
tree.jstree({
...
"dnd": {
"drop_finish": function (data) {
alert("some message");
}
}
"plugins": [..., "dnd"]
});
回答1:
The error is with the html.
Use class="jstree-drop" along with IDs for all the nodes. It will work.
The other method could be with tree.bind("move_node.jstree", function (event, data){ // your code }
来源:https://stackoverflow.com/questions/4569798/issue-with-jstree-drag-drop