【问题标题】:jstree dnd restriction using angularjs使用angularjs的jstree dnd限制
【发布时间】:2015-07-16 13:42:23
【问题描述】:

我正在尝试使用 angularjs 限制节点下降到某些特定节点。为此,我覆盖了一些 jstree 事件,例如 move_node、dnd_move.vakata。没有任何效果。

【问题讨论】:

    标签: jstree jstree-dnd


    【解决方案1】:

    您无法覆盖事件 - 只需对它们做出反应。您正在寻找的配置选项是core.check_callback。至于角度 - 这取决于您使用的包装器 - 我自己不使用角度,所以我无法帮助您 - 只要确保您使用 core.check_callback - 这是一个回调,在结构更改即将执行时执行发生:

    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;
      },...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多