2011-06-08 45 views
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"); 
      }) 

回答

4

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

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

这家伙最好放在一起体面的文档时,发布了新的版本CUS当前的太差劲了。

+0

谢谢,我一直在寻找:) – 2013-01-11 14:02:03

相关问题