0

質問は簡単ですが、これに似たものは見つかりませんでした。dnd プラグインで fancytree を有効にしたいのですが、各ノードは独自の親を維持する必要があります (ルートの場合はルートのままにする必要があります)。

ありがとう、リカルド

4

1 に答える 1

0

これは私が探していた解決策です:

extensions: ["dnd"],
dnd: {
    autoExpandMS: 400,
    focusOnClick: true,
    preventVoidMoves: true, // Prevent dropping nodes 'before self', etc.
    preventRecursiveMoves: true, // Prevent dropping nodes on own descendants
    dragStart: function(node, data) {
        // if false dnd is disabled
        return true;
    },
    dragStop: function(node, data) {
        return true;
    },
    dragEnter: function(node, data) {
        if(node.parent !== data.otherNode.parent) return false;
        return true;
    },
    dragDrop: function(node, data) {
      // if dropped to another node insert it before!
      data.otherNode.moveTo(node, "before");
}
于 2014-08-29T09:36:25.147 に答える