任何人都能告诉我为什么绑定“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");
})
答案 0 :(得分:4)
最后一天半后我找到了合适的发行号码! :-D如果你遇到同样的问题,请查看解决方案:
http://code.google.com/p/jstree/issues/detail?id=805
这个家伙最好在新版本发布时整理出一套体面的文档,因为当前的版本很糟糕。