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

Custom Close radwindow

1 Answer 102 Views
Window
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 15 Jul 2009, 10:26 AM

Hi,
I want to override default close in radwindow (at top-right icon).
I tried in js:

TelerikTelerik.Web.UI.RadWindow.prototype.oldClose = Telerik.Web.UI.RadWindow.prototype.close;  
Telerik.Web.UI.RadWindow.prototype.close = function(callBackFnArg) {  
    //your code goes here     
    alert("closing");  
    //call old close method     
    this.oldClose(callBackFnArg);  
}; 
but I get an error about: no definition of 'Telerik'.
So how can I write my own close function in js?

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 16 Jul 2009, 01:49 PM
Hi Jaromin,

In the newer versions of the RadWindiow control (Q3 2008 and later) we implemented an OnClientBeforeClose event. In your case you could use this event and implement your logic in its handler. Also you could cancel the close by using the following simple approach :

  • attach the event handler :
    <telerik:RadWindow ID="RadWindow1" runat="server" OnClientBeforeClose="OnWindowCloseHandler"
    </telerik:RadWindow> 
  • Implement the handler as follow :
    function OnWindowCloseHandler(oWindow, args) 
        // Your logic here ... 
     
        // You could cancel the closing
        args.set_cancel(true); 

I hope this helps.

Greetings,
Fiko
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.
Tags
Window
Asked by
wnl
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or