I have two treeviews side by side populated from a server-side source.
The left treeview contains permissions that are grouped.
The right treeview contains persons.
I've set up rules in the drop events to prevent a user from dragging anything but a permission to anything but a person:
$("#tvw-permissions").kendoTreeView({
dragAndDrop: true,
dataSource: permissiondatasource,
dataTextField: ["Text"],
dataSpriteCssClassField: ["SpriteCssClass"],
drop: function (e) {
var srcTree = $($(e.sourceNode).closest("div.k-treeview")).data("kendoTreeView").element[0].id;
var destTree = $($(e.destinationNode).closest("div.k-treeview")).data("kendoTreeView").element[0].id;
if (srcTree == destTree) {
e.setValid(false);
}
var destinationid = $('#' + destTree).data("kendoTreeView").dataSource
.getByUid($(e.destinationNode).data("uid")).id;
if (!destinationid.startsWith('person')) {
e.setValid(false);
return;
}
}
So far so good. I do however want to be able to drag the same permission to multiple people. The Kendo Treeview does a 'move node' on the drag-drop operation.
How do I get to keep the dragged node on the source tree from being moved?