JsTree v3.0 drag and drop plugin. Reference target node upon dropping

后端 未结 8 915
南笙
南笙 2021-01-12 09:30

I use drag and drop plugin of jsTree library (ver. 3.0) With the following code I can bind to the end of drag\'n\'drop action, but I can not see a way to get the reference t

8条回答
  •  旧时难觅i
    2021-01-12 10:11

    To get the target node you use the dnd_stop.vakata event. Once you get the node you can access to the different properties like id:

    $(document).bind("dnd_stop.vakata",function(e, data) {
        var targetNode = $('#jstree').jstree(true).get_node($(data.event.target));
        var nodeId = targetNode.id;
    });
    

提交回复
热议问题