jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Preventing closing a wndow
Tagged: jquery dialog, jqxwindow
This topic contains 7 replies, has 7 voices, and was last updated by assembler 6 years, 10 months ago.
-
Author
-
Hello!
Is there a way to prevent a window close, once caught the “closed” event?
I would like to intercept this event with a famous “Are you sure?” message and give the user possibility to get back to the window.
Thank you,
Aleks.
Hi Aleks,
We will consider adding ‘closing’ event with option to cancel it in a future version. We will create a work item about your feature request.
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comPeter,
I would also like to suggest this is a very valuable feature. Users do goofy things and to make products friendly we have to ensure they don’t lose unsaved edits or fix errors before leaving such that data can be saved. Currently the process is ugly as the dialog fully closes and the only thing I can do is reopen the dialog, but that quickly becomes a hack as you have to bypass all the normal open functions as this is a “reopen”. Bottom line, having the ability to cancel the close would be a nice addition.
Mike
I was searching the site to see if there was a way to cancel the close of a windows if after some validation I find errors when I stumbled on this post. So… It there a way or not. According to this post, there isn’t. Can you suggest a way to perform validation and cancel the close of a window.
I’m assuming I could hide the “X” (close button), add two button binding each to a function which would do the validation and close the windows but that would not be super clean.
If there isn’t a clean way to do this, I would also like to suppor the request for a “closing” event that would allow for adding validation to the form.
Thank you
Did something new happen about that? I also need this feature.
Peter Stoev ?
Dimitar ?
Is there any page where we can vote for features?Hi out there!
If someone is still looking for some workarround for this, what I did on my jqxWindow was:Set
– showCloseButton: false
– cancelButton: null
– keyboardCloseKey :’none’then I created a jqxButton (#closeWinButton) and:
$(‘#closeWinButton’).on(‘click’, function() {
if( $(“#some_condition”).val() ) {
if( confirm(“Do you really want to exit (without saving) ?”) ) {
$(“#myWindow”).jqxWindow(‘close’);
}
} else {
$(“#win”).jqxWindow(‘close’);
}
});Is there any advance on this?
-
AuthorPosts
You must be logged in to reply to this topic.