Issue with JSTree drag drop

雨燕双飞 提交于 2019-12-30 11:33:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!