Possible BUG after upgrade to the Q2 version of the controls

2 posts, 0 answers
  1. Martin
    Martin avatar
    84 posts
    Member since:
    Apr 2009

    Posted 27 Jul 2009 Link to this post

    We've upgraded recently to the most recent Q2 version of the controls.
    There appears to be a bug. It deals with the Rad Dock.
    Here is what happens, unlike before in the Q1 version

    dock.set_closed(

    false);

     

    and

    dock.set_closed(true)

    ;
    are now handled by Dock's OnClientCommand handler.
    This is fine, but in that handler I have no idea if I am closing the doc or opening, because the boolean parameter is not available, which causes a problem since we have the following:

     

    if

     

    (cmd.get_name() == "Close" )
    {
        do some work...
    }
    I never had this issue before because OnClientCommand was only hit when the user pressed the X button on the Dock.
    Please help, as we

     

  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 30 Jul 2009 Link to this post

    Hello Martin,

    I believe you know that it can be checked whether the dock is closed or not, by calling the dock.get_closed() method which returns a boolean value. I have implemented a sample project that dynamically closes and opens a RadDock. Everything is working fine and messages are displayed to notify the user whether the dock is closed or opened. This is the source code:

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head id="Head1" runat="server"
        <title></title
     
        <script type="text/javascript"
            function OnClientCommand(dock, args) 
            { 
                alert("Command pressed: " + args.command.get_name()); 
     
                if (dock.get_closed()) 
                { 
                    alert("You have closed the dock"); 
                } 
                else 
                { 
                    alert("You have opened the dock"); 
                } 
            } 
     
            function GetClosed() 
            { 
                var dock = $find("RadDock1"); 
                alert("Is Dock Closed: " + dock.get_closed()); 
            } 
     
            function ReOpenDock() 
            { 
     
                var dock = $find("RadDock1"); 
                if (dock.get_closed()) 
                { 
                    dock.set_closed(false); 
                } 
            } 
     
            function CloseDock() 
            { 
                var dock = $find("RadDock1"); 
                if (dock.get_closed() == false) 
                { 
                    dock.set_closed(true); 
                } 
            } 
        </script> 
     
    </head> 
    <body> 
        <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager> 
        <input id="btnCheckDock" type="button" value="Check if dock is closed" onclick="GetClosed()" /> 
        <br /> 
        <input id="btnReOpenDock" type="button" value="Re-Open Dock (JavaScript)" onclick="ReOpenDock()" /> 
        <br /> 
        <input id="btnCloseDock" type="button" value="Close Dock (JavaScript)" onclick="CloseDock()" /> 
        <div> 
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server"
                <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="300px" Width="300px"
                    <telerik:RadDock ID="RadDock1" runat="server" Width="300px" Title="RadDock-Title" 
                        OnClientCommand="OnClientCommand"
                        <Commands> 
                            <telerik:DockCloseCommand /> 
                            <telerik:DockExpandCollapseCommand /> 
                        </Commands> 
                        <ContentTemplate> 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                            CONTENT 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </telerik:RadDockLayout> 
        </div> 
        <asp:Button ID="Button1" runat="server" Text="Make Postback" /> 
        </form> 
    </body> 
    </html> 
     

    Greetings,
    Pero
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top