我正在使用Kendo Sortable。我想从一个列表中拖动一个项目以填充另一个,但我需要将该项目保留在原始列表中。有没有人知道如何做到这一点?
答案 0 :(得分:2)
可排序的替代方案可能是可拖动的& DropTarget的。
查看Moving items from one list to another。
$("#listB").kendoDropTarget({
dragenter: addStyling,
dragleave: resetStyling,
drop: function(e) { //apply changes to the data after an item is dropped
var draggableElement = e.draggable.currentTarget,
dataItem = listA_DS.getByUid(draggableElement.data("uid")); //find the corresponding dataItem by uid
//--- Change --- listA_DS.remove(dataItem); //remove the item from ListA
listB_DS.add(dataItem); //add the item to ListB
resetStyling.call(this); //reset visual dropTarget indication that was added on dragenter
}
});