为什么移动一组节点时,对于第一个节点,绑定“ move_node.jstree”仅触发一次?
作者:互联网
谁能告诉我为什么移动一组节点时,对于第一个节点,绑定“ 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
当新版本发布时,这个家伙最好整理一套不错的文档,因为当前的版本很烂.
标签:jstree,javascript,jquery 来源: https://codeday.me/bug/20191102/1992197.html