在ASP MVC中拖放问题Kendo UI Web TreeView

时间:2021-06-25 01:16:30

I have an issue in kendo treeView. I am doing validation in kendo treeview when the user drags and drop a node by using dragstart, dragend, drop events.

我在kendo treeView中有一个问题。当用户使用dragstart,dragend,drop事件拖动和删除节点时,我正在kendo树视图中进行验证。

Issue is, I need to maintain unique node names in every level. when user drop a node then I am checking the selected node with the destination node details by using following function-

问题是,我需要在每个级别维护唯一的节点名称。当用户删除一个节点时,我正在使用以下功能检查所选节点的目标节点详细信息 -

var destNode = this.dataItem(e.destinationNode);

var destNode = this.dataItem(e.destinationNode);

if the user moves the node one level up then e.destinationNode giving the neighbhour node details based on the I not able to maintain uniqueness. This is the issue.

如果用户将节点向上移动一级,则e.destinationNode根据我不能保持唯一性给出邻居节点的详细信息。这是问题所在。

Is there any property to disable move option, I should continue only drag and drop.

是否有任何属性禁用移动选项,我应该继续只拖放。

Thanks in Advance....

提前致谢....

1 个解决方案

#1


0  

You can e.preventDefault inside the drop event if your condition is not satisfied when you want to cancel the drop. You can find more info here

如果要取消放置,如果不满足条件,则可以在放置事件内e.preventDefault。你可以在这里找到更多信息

#1


0  

You can e.preventDefault inside the drop event if your condition is not satisfied when you want to cancel the drop. You can find more info here

如果要取消放置,如果不满足条件,则可以在放置事件内e.preventDefault。你可以在这里找到更多信息