ASP.NET 3.5 and above only

ASP.NET TreeView - Client-side Events

  • Libraries
    • Documents
      • My Documents
      • Public Documents
    • Music
      • My Music
      • Public Music
    • Pictures
      • My Pictures
      • Public Pictures
    • Videos
      • My Videos
      • Public Videos










   Event Log :
[ASPX]

<obout:Tree ID="ObClassicTree" EnableDragAndDrop="true" AllowNodeEdit="true" 
    OnBeforeNodeEdit="clientOnBeforeNodeEdit"
    OnNodeEdit="clientOnNodeEdit" 
    OnNodeCollapse="clientOnNodeCollapse" 
    OnNodeExpand="clientOnNodeExpand"
    OnNodeDragging="clientOnNodeDragging"
    OnNodeDragStart="clientOnNodeDragStart"
    OnNodeDrop="clientOnNodeDrop" 
    OnNodeMouseOut="clientOnNodeMouseOut" 
    OnNodeMouseOver="clientOnNodeMouseOver"
    OnNodeSelect="clientOnNodeSelect" 
    CssClass="vista" runat="server" Width="200px">
</obout:Tree>                 
            
[Javascript]

   function clientOnBeforeNodeEdit(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnBeforeNodeEdit.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnBeforeNodeEdit' event is fired on '" + sender.getNodeText(args.node) + "'");
            }
        }
        function clientOnNodeEdit(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeEdit.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeEdit' : '" + args.text + "' is renamed as '" + args.newText + "'");
            }
        }
        function clientOnNodeCollapse(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeCollapse.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeCollapse' event is fired on '" + sender.getNodeText(args.node) + "'");
            }
        }
        function clientOnNodeExpand(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeExpand.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeExpand' event is fired on '" + sender.getNodeText(args.node) + "'");
            }
        }
        function clientOnNodeDragging(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeDragging.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeDragging' event is fired on '" + sender.getNodeText(args.sourceNode) 
                + ". Mouse at (" + args._event.clientX + ',' + args._event.clientY + ")'");
            }
        }
        function clientOnNodeDragStart(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeDragStart.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeDragStart' event is fired on '" + sender.getNodeText(args.sourceNode) + "'");

            }
        }
        function clientOnNodeDrop(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeDrop.ClientID %>');
            if (chk.checked) {
                if (sender.isNode(args.target)) {
                    addLogEntry("'OnNodeDrop' event is fired. Source Node : '" + sender.getNodeText(args.sourceNode) 
                    + "',  Target Node : '" + sender.getNodeText(args.target) + "'");
                }
            }
        }
        function clientOnNodeMouseOut(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeMouseOut.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeMouseOut' event is fired on '" + sender.getNodeText(args.node) + "'");
            }
        }
        function clientOnNodeMouseOver(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeMouseOver.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeMouseOver' event is fired on '" + sender.getNodeText(args.node) + "'");
            }
        }
        function clientOnNodeSelect(sender, args) {
            var chk = document.getElementById('<%=this.chk_OnNodeSelect.ClientID %>');
            if (chk.checked) {
                addLogEntry("'OnNodeSelect' event is fired on '" + sender.getNodeText(args.node) + "'");
            }
        }
        function addLogEntry(msg) {
            document.getElementById('eventLog').innerHTML += "<span>" + msg + "</span";
        }
        function clearLog() {
            document.getElementById('eventLog').innerHTML = "";
        }                
            

"First of all... loved the controls... its wonderful features and ease of use. Most of all, I would like to commend your support group. Even if we're still in evaluation mode, the support team has been great and very response. Keep up the great work!"

James Gagni Jr.
Aon Singapore

Random testimonial   All testimonials