0

I am trying to restrict nodes from dropping to some particular nodes using angularjs. For that am overriding some of the jstree events like the move_node, dnd_move.vakata. Nothing works.

1 Answers1

0

You can't override events - just react to them. The config option you are looking for is core.check_callback. As for angular - it depends on which wrapper you are using - I do not use angular myself so I can't help you there - just make sure you use core.check_callback - it is a callback that gets executed as structure changes are about to happen:

core : {
  check_callback : function (op, node, parent, position, more) {
    if(more && more.dnd) {
      // do checks here and return false to prevent the drop 
      // or return true to allow it
      // depending on the node / parent / position arguments
    }
    return true;
  },...
vakata
  • 3,726
  • 1
  • 17
  • 31