2

I am using jsTree V3.0.8 (http://www.jstree.com/)

how to reorder only when use dnd plugin like at V1(http://johntang.github.io/JsTree/_docs/dnd.html#demo2)

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
thinhnk
  • 351
  • 3
  • 12

1 Answers1

4

Use the check_callback option like this:

"check_callback" : function (op, node, par, pos, more) {
    if(more && more.dnd) {
        return more.pos !== "i" && par.id == node.parent;
    }
    return true;
},

Here is a demo: http://jsfiddle.net/DGAF4/509/

vakata
  • 3,726
  • 1
  • 17
  • 31