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

[Solved] Prevent window from Closing in onClose client event

3 Answers 137 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kapil
Top achievements
Rank 1
Kapil asked on 18 Jul 2012, 01:45 PM
Hello Everyone,

I am trying to display a confirm dialog when a user tries to close a window by click the 'X' in the top right corner. If the user goes for 'OK' option,  I would like to continue closing the window but if the user presses the 'Cancel' button I would like to prevent the window from closing. Is there a way to do that?

Thanks.

Update: I looked at the window client events on : http://demos.telerik.com/aspnet-mvc/window/clientsideevents. It says that the onClose event is cancellable but nowhere can I see how to cancel the event.

3 Answers, 1 is accepted

Sort by
0
Kapil
Top achievements
Rank 1
answered on 20 Jul 2012, 02:17 PM
Does nobody know how to solve this problem??
0
Kapil
Top achievements
Rank 1
answered on 25 Jul 2012, 10:23 PM
Does no telerik admin know the solution to this??
0
Kapil
Top achievements
Rank 1
answered on 26 Jul 2012, 02:33 PM

I was able to figure out the solution to my problem on my own. if you do

e.preventDefualt();
in the onClose event it would prevent the window from closing. There is a mention in the documentation that the onClose event is cancellable but nowhere does it say how to cancel the onclose event.
Tags
Window
Asked by
Kapil
Top achievements
Rank 1
Answers by
Kapil
Top achievements
Rank 1
Share this question
or