質問は簡単ですが、これに似たものは見つかりませんでした。dnd プラグインで fancytree を有効にしたいのですが、各ノードは独自の親を維持する必要があります (ルートの場合はルートのままにする必要があります)。
ありがとう、リカルド
質問は簡単ですが、これに似たものは見つかりませんでした。dnd プラグインで fancytree を有効にしたいのですが、各ノードは独自の親を維持する必要があります (ルートの場合はルートのままにする必要があります)。
ありがとう、リカルド
これは私が探していた解決策です:
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");
}