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

closing Radalert with Esc key

1 Answer 58 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ravi Gorrepati
Top achievements
Rank 1
Ravi Gorrepati asked on 18 Sep 2008, 06:38 AM
Hi,

help me solving this.
i have to close the radalert and radconfirm boxes by pressing Esc key.

the normal radwindow i can able to close by calling close() method.
but does radalert and confirmbox have that close method.

can u tell me the way to do this.

thanks,
Ravi Gorrepati.

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 18 Sep 2008, 04:15 PM
Hello Ravi,

Yes, the radalert and radconfirm dialogs have the close() method as the standard RadWindow. In order to call this method you should obtain a reference to the dialog in this manner: var alertMsg = radalert('test'); After you have done this, you can call the close method of the alertMsg object.

I am not quite sure about your exact scenario and that is why I prepared for you a simple script which closes the alert after some timeout, justo to demonstrate how this should be done:

function CallAndCloseAlert()  
{  
  var alertMsg =  radalert('test');  
  setTimeout(function(){alertMsg.close();}, 1000);  
    
}  
 
 

Feel free to modify the script further in order to meet your particular needs.




Kind regards,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Ravi Gorrepati
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or