RadWindow client hide() leaves modal overlay

3 posts, 0 answers
  1. Sean
    Sean avatar
    51 posts
    Member since:
    May 2008

    Posted 02 Oct 2013 Link to this post

    Using the provided code - the modal closes but the overlay is left open ... what am I doing wrong?

    var window;
    function OpenWindow(){
       window = $find('<%= mywindow.ClientID %>');
       window.show();
    }
     
    function CloseWindow(){
       window.hide();
    }
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Oct 2013 Link to this post

    Hi Sean,

    Please have a look into the following code snippet that I tried which works fine at my end.

    ASPX:
    <telerik:RadWindow ID="RadWindow1" runat="server">
    </telerik:RadWindow>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Open Window" OnClientClicked="OpenWindow"
        AutoPostBack="false">
    </telerik:RadButton>
    <telerik:RadButton ID="RadButton2" runat="server" Text="Close Window" OnClientClicked="CloseWindow"
        AutoPostBack="false">
    </telerik:RadButton>

    JavaScript:
    <script type="text/javascript">
        function OpenWindow(sender, args) {
            var window;
            window = $find('<%= RadWindow1.ClientID %>');
            window.show();
        }
        function CloseWindow(sender, args) {
            var window;
            window = $find('<%= RadWindow1.ClientID %>');
            window.hide();
        }
    </script>

    Please elaborate your requirement  if it doesn't help you.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 03 Oct 2013 Link to this post

    Hi guys,

    The hide() method does not remove the modal background by design. You can call the dialog's set_modal(false) method after hide() if you want this to happen, or you could use the close() method instead (but note, that it will fire the OnClientBeforeClose and OnClientClose events). The case is the same with minimizing - it will not change the modal state of the control automatically.

    @Sean - you re not doing anything wrong, this is the control's behavior.
    @Shinu - Sean has a modal RadWindow while your test doesn't.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top