Loading... message with ExpandMode.ServerSide

1 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 04 Sep 2007 Link to this post


    Requirements

    RadTreeView version

    6.2.2
    RadTreeView AJAX (Prometheus)
    Telerik.Web.UI 2007.3.1425

    .NET version 2.0
    Visual Studio version

    VS2005
    programming language

    C#
    browser support

    all browsers supported by RadControls


     
    PROJECT DESCRIPTION
    We often receive inquiries about how to show a "Loading..." message when the TreeNodes are being expanded via ExpandMode.ServerSide. The approach is quite straightforward:




    ASPX:

    <telerik:RadTreeView ID="RadTreeView1"  
    runat="server"  
    OnClientNodeExpanding="onExpanding" 
    OnNodeExpand="RadTreeView1_NodeExpand"

    JavaScript:

    <script type="text/javascript"
    function onExpanding(sender, eventArgs) 
        var element = eventArgs.get_node().get_textElement(); 
        element.innerHTML = "<b>Loading...</b> " + eventArgs.get_node().get_text(); 
    </script>  




    ASPX:

    <rad:RadTreeView ID="RadTreeView2"  
    BeforeClientToggle="BeforeToggle" 
    runat="server"
    </rad:RadTreeView> 

    JavaScript:
    <script> 
            function BeforeToggle(node)  
            {   
                if(!node.Expanded)                   
                    node.TextElement().innerHTML = "<B>Loading...</B>";    
                return true;                         
            } 
        </script> 

Back to Top