View Full Version : [CLOSED] TreeViewDragDrop plugin on over event

Sep 12, 2012, 10:28 AM

I am trying to use a TreeViewDragDrop plugin for nodes reordering. I have nodes of different types, and nodes of one type could not be dropped to nodes of other type. I was abble to implement this using BeforeDrop listener (I return false, when types are different). However I did not find any way to show user, that this drop operation is not allowed (no Over listener).

Could you suggest a way to solve this issue?

Best regards.

Sep 12, 2012, 12:37 PM
Hi Leonid,

Unfortunately, there is no built-in option to change this behavior.

But I can suggest to override the isValidDropPoint function of the ViewDropZone class.


<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<head runat="server">
<title>Ext.NET v2 Example</title>

<script type="text/javascript">
var onAfterRender = function (view) {
var dz = view.getPlugin("dragdrop").dropZone;

dz.isValidDropPoint = Ext.Function.createInterceptor(dz.isValidDropPoint , function (node, position, dragZone, e, data) {
return false; // please implement as you need
<ext:ResourceManager runat="server" />

<ext:TreePanel runat="server">
<ext:Node Text="Root (level 0)" Expanded="true">
<ext:Node Text="Node1 (level 1)" Expanded="true">
<ext:Node Text="Node1 (level 2)" Expanded="true">
<ext:Node Text="Node1 (level 3)" Leaf="true" />
<ext:Node Text="Node2 (level 3)" Leaf="true" />
<ext:TreeView runat="server">
<ext:TreeViewDragDrop PluginId="dragdrop" runat="server" />
<AfterRender Fn="onAfterRender" />

Sep 12, 2012, 2:38 PM
Thank you, Daniil. This works perfect.

Dec 21, 2012, 7:39 AM
You may be interested to look at this example.