Move_node.jstree - search / understanding of operation result parameters

I am using jsTree 1.0-rc3 . I try to find the parameters of the result of the operation, such as the parent of a new position, the new order of positions (the index of the element among all the children of this parent), etc. I managed to find out that:

  • data.rslt.op.attr("id") = old parent id
  • data.rslt.np.attr("id") = new parent id

but I don’t know about the rest. jstree is missing documentation here, I spent several hours with it and I ran out of ideas. By the way, someone can decode the abbreviations of the result, this is:

  • cop
  • cp
  • cr
  • np - new parent
  • o
  • op - old parent
  • or
  • ot
  • p
  • r
  • rt

I like jstree, but this naming convention is driving me crazy.

+4
source share
3 answers

I know what o is. o - means obj. When moving (dragging) a node, the moved object is in o.

You can access this object using

 data.rslt.o.attr("id"); 

If you need to use to access the objects on which the click event was triggered

 data.rslt.obj.attr("id"); 
+1
source

This is valid in the jstree kernel documentation. Right below

  http://www.jstree.com/documentation/core.html 

where it is mentioned when the description is described ._get_move ()!

+1
source

.o - move node

.r - node link in move

.ot - an instance of the tree of origin

.rt - instance of the link tree

.p - position to move (there may be a line - "last", "first", etc.)

.cp - calculated position to move (always a number)

.np - new parent

0
source

All Articles