[CLOSED] TreePanel BeforeNodeDrop Event

  1. #1

    [CLOSED] TreePanel BeforeNodeDrop Event

    I need to check the node drop condition so that only when the condition is matched, drop event will be triggerd otherwise return false to cancel the drop. I'am using the latest version of Ext.net dll file, Is BeforeNodeDrop property is missing on this version or any other similar property if available to achieve this ?


    Thanks



    Which property can be used on the following scenario?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestTree.aspx.cs" Inherits="Web.Report.TestTree" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.BuildTree(TreePanel1.Root);
            }
        }
    
        private Ext.Net.NodeCollection BuildTree(Ext.Net.NodeCollection nodes)
        {
            if (nodes == null)
            {
                nodes = new Ext.Net.NodeCollection();
            }
    
            Ext.Net.Node root = new Ext.Net.Node();
            root.Text = "Root";
            nodes.Add(root);
    
            string prefix = DateTime.Now.Second + "_";
    
            for (int i = 0; i < 5; i++)
            {
                Ext.Net.Node node = new Ext.Net.Node();
                Ext.Net.Node node1 = new Ext.Net.Node();
                node1.Text = "Test";
                node1.Leaf = true;
                node.NodeID = i.ToString();
                node.Text = prefix + i;
                node.Children.Add(node1);
                root.Children.Add(node);
            }
    
            return nodes;
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="Form1" runat="server">
           <c:ContentHeader ID="ContentHeader_one" runat="server" />
             <ext:TreePanel 
             ID="TreePanel1"
             runat="server"
             Title="Account List" 
             Icon="ApplicationEdit"
             AutoScroll="true" 
             ContainerScroll="true" 
             RootVisible="false" 
             Height="500" 
             EnableDD="true" 
             Mode="Local"
             Width="500"  
             RemoteJson="false">                        
               
                <View>
                    <ext:TreeView ID="TreeView1" runat="server">
                        <Plugins>
                            <ext:TreeViewDragDrop ID="TreeViewDragDrop1" runat="server" AppendOnly="true">
                            </ext:TreeViewDragDrop>
                        </Plugins>
                    </ext:TreeView>
                </View>
                
            </ext:TreePanel>
        </form>
    </body>
    </html>
    Last edited by Daniil; Apr 09, 2012 at 6:58 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use BeforeDrop event of TreeView
    That event uses the following arguments
    (node,data,overModel,dropPosition,dropFunction)

    target nodes - data.records
    destination node - overModel

Similar Threads

  1. Replies: 5
    Last Post: Apr 16, 2012, 4:14 PM
  2. [CLOSED] TreePanel missing beforedoubleclick event
    By jchau in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 30, 2011, 6:11 AM
  3. Treepanel SubmitNodes Event Extraparams
    By children_of_the in forum 1.x Help
    Replies: 0
    Last Post: Oct 25, 2011, 11:43 AM
  4. Treepanel beforeload event problem
    By Mr.Techno in forum 1.x Help
    Replies: 1
    Last Post: Sep 22, 2011, 7:32 AM
  5. Treepanel click event
    By Mr.Techno in forum 1.x Help
    Replies: 0
    Last Post: Sep 21, 2011, 5:28 AM

Tags for this Thread

Posting Permissions