I want to cancel the context model when popup is closed with ‘X’. This is because, when you change something on a popup and close it by clicking ‘X’ it does not cancel the changes unless you hit cancel button; which is confusing. I tried following code to cancel the model but it cancels all the models which have unsaved changes.
$(window).on(‘dialogclose’, function(ctxt) {
$.each(skuid.model.list(), function(i,m){
if(!($.isEmptyObject(m.changes))){
m.cancel();
}
});
});
How could I just cancel the models which are in current popup’s context. Any Idea?
Thanks!
Question
Cancel context model when popup(dialog) is closed with close ( 'X' ) button

This topic has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.