3
任何人都可以告诉我为什么绑定“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");
})
谢谢,我一直在寻找:) – 2013-01-11 14:02:03