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

ESC closes non modal RadWindow

2 Answers 66 Views
Window
This is a migrated thread and some comments may be shown as answers.
Teodorico
Top achievements
Rank 1
Teodorico asked on 18 Jul 2009, 01:45 AM

Hi,

I am having issues when a user clicks outside the RadWindow and then presses ESC. This closes the window and it is happening on IE 7/ IE 8 and FF 3.5.

I found this post: http://www.telerik.com/community/forums/aspnet-ajax/window/radwindow-issues-in-firefox-3-0-5.aspx

Which kind of help me but it does not work on FF since there is no access to window.event:

  

 

<script type="text/javascript">  
    TelerikTelerik.Web.UI.RadWindow.prototype.old_close = Telerik.Web.UI.RadWindow.prototype.close; // Store the original function  
    Telerik.Web.UI.RadWindow.prototype.close = function(e)  
    {  
        //Override close  
        var ESC = 27; // ESC Key code is 27  
        if (window.event && window.event.keyCode == ESC)  
        {  
            return true;  
        }  
        else this.old_close(); // Call original function  
    }  
</script> 
 


Should there be a property allowing to configure this behavior?
Any help would be appreciated.

 

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 21 Jul 2009, 12:04 PM
Hi Teodorico,

Try the following JavaScript:
Telerik.Web.UI.RadWindowControllerClass.prototype.hideCurrentWindowIfNonModal = function() { }; 


Greetings,
Georgi Tunev
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.
0
Teodorico
Top achievements
Rank 1
answered on 21 Jul 2009, 10:36 PM

It worked perfectly.

Thanks.
Tags
Window
Asked by
Teodorico
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Teodorico
Top achievements
Rank 1
Share this question
or