为什么绑定“;move_node.jstree”;移动一组节点时,第一个节点只激发一次

Why does binding "move_node.jstree" only fire once, for the first node, when moving a group of nodes?

本文关键字:节点 第一个 一次 绑定 jstree node 移动 move 为什么 一组      更新时间:2023-09-26

有人能告诉我为什么绑定"move_node.jstree"在移动一组节点时只为第一个节点触发一次吗?以及如何检测移动的所有节点?

我需要检测所有被移动的节点,这样我就可以通过自定义的ajax函数进行报告。这是我目前正在使用的,但它只为我选择的同时移动的节点中的第一个节点运行。

.bind("move_node.jstree", function (e, data) {
            /*
            data.rslt contains: 
            .o - the node being moved 
            .r - the reference node in the move 
            .ot - the origin tree instance 
            .rt - the reference tree instance 
            .p - the position to move to (may be a string - "last", "first", etc) 
            .cp - the calculated position to move to (always a number) 
            .np - the new parent 
            .oc - the original node (if there was a copy) 
            .cy - boolen indicating if the move was a copy 
            .cr - same as np, but if a root node is created this is -1 
            .op - the former parent 
            .or - the node that was previously in the position of the moved node 
            */
            var eventID = data.rslt.o.attr("id").substring(11);
            var groupID = data.rslt.np.attr("id").substring(11);
            commitEventMove(eventID,groupID);
            //alert("bind-move_node fired");
           })

一天半后,我终于找到了正确的问题编号!:-D如果你有同样的问题,请查看解决方案:

http://code.google.com/p/jstree/issues/detail?id=805

这个家伙最好在新版本发布时整理一套像样的文档,因为当前版本有问题。