ツリー ビューのドラッグ アンド ドロップに Ignite UI を使用しています。
ドラッグしたアイテムをリストに保持する方法はありますか?
アイテムが新しい場所にドロップされると、以前の場所からアイテムが削除されます。アイテムを両方の場所に保管するにはどうすればよいですか?
$("#StructureList").igTree({
singleBranchExpand: true,
checkboxMode: 'triState',
dataSource: data,
dataSourceType: 'json',
bindings: {
textKey: 'LineName',
valueKey: 'LineID',
imageUrlKey: 'ImageUrl',
childDataProperty: 'FacDetails',
bindings: {
textKey: 'FacName',
valueKey: 'FacID',
childDataProperty: 'strDetails',
bindings: {
textKey: 'strName',
valueKey: 'strID'
}
}
},
dragAndDrop: true,
dragAndDropSettings: {
allowDrop: true,
dragAndDropMode: "copy",
customDropValidation: function (element) {
// Validates the drop target
var valid = true,
droppableNode = $(this);
if (droppableNode.is('a') && droppableNode.closest('li[data-role=node]').attr('data-value') === 'File') {
valid = false;
}
return valid;
}
}
});