1
是否有方法將Fancytree A組合爲一組固定配置項目,Fancytree B是配置文件,Fancytree A中的項目可以拖動到Fancytree B沒有在樹A中消失。在Fancytree B中,拖動&也應該是可能的。在兩個Fancetrees之間拖放
我搜索了一段時間,但還沒有找到我正在尋找什麼,所以也許有人知道如何做到這一點!
是否有方法將Fancytree A組合爲一組固定配置項目,Fancytree B是配置文件,Fancytree A中的項目可以拖動到Fancytree B沒有在樹A中消失。在Fancytree B中,拖動&也應該是可能的。在兩個Fancetrees之間拖放
我搜索了一段時間,但還沒有找到我正在尋找什麼,所以也許有人知道如何做到這一點!
使用標準功能從不同的樹或甚至標準的jQuery Draggables
中拖拽節點是絕對有可能的。
基本上你使用相同的API
$("#tree").fancytree({
extensions: ["dnd"],
...
dnd: {
...
dragStart: function(node, data) {
if(data.originalEvent.shiftKey){
console.log("dragStart with SHIFT");
}
// allow dragging `node`:
return true;
},
dragEnter: function(node, data) {
// Prevent dropping a parent below another parent (only sort
// nodes under the same parent)
/* if(node.parent !== data.otherNode.parent){
return false;
}
// Don't allow dropping *over* a node (would create a child)
return ["before", "after"];
*/
return true;
},
dragDrop: function(node, data) {
if(!data.otherNode){
// It's a non-tree draggable
var title = $(data.draggable.element).text() + " (" + (count)++ + ")";
node.addNode({title: title}, data.hitMode);
return;
}
data.otherNode.moveTo(node, data.hitMode);
}
}
});
的例子瀏覽器包含Examples - Test - Drag'n'Drop