This is a migrated thread and some comments may be shown as answers.

RadWindow client hide() leaves modal overlay

2 Answers 342 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 02 Oct 2013, 02:14 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Oct 2013, 04:25 AM
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.
1
Marin Bratanov
Telerik team
answered on 03 Oct 2013, 10:58 AM
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.
Tags
Window
Asked by
Sean
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Marin Bratanov
Telerik team
Share this question
or