jQuery EasyUI Forum
May 19, 2013, 10:13:13 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: $.messager.alert Callback Doesn't Fire on Window Close, Only on Button Click  (Read 2493 times)
angers
Newbie
*
Posts: 11


View Profile Email
« on: June 24, 2012, 07:27:51 AM »

$.messager.alert("ERROR",
                "COMMUNICATIONS ERROR.<br/>Please check your internet connection.",
                "error",
                function(){
                    window.location.href = '';
                }
);


A messager alert box can be closed 2 ways. Either by clicking the automatically generated "Ok" button OR by clicking on the close window icon at the top of the alert box. Since there is no closable:false option on $.messager, the user has the option to exit an alert box without triggering the callback.

Please fix.
« Last Edit: June 24, 2012, 07:29:32 AM by angers » Logged
angers
Newbie
*
Posts: 11


View Profile Email
« Reply #1 on: June 26, 2012, 07:41:29 AM »

And...no answer.
Logged
angers
Newbie
*
Posts: 11


View Profile Email
« Reply #2 on: June 28, 2012, 02:46:04 AM »

...
Logged
stworthy
Administrator
Hero Member
*****
Posts: 645


View Profile Email
« Reply #3 on: June 28, 2012, 05:42:34 PM »

There are no options to disable the closable button for messager in current version. The messager is created based on window, so there has one way to hide this closable button. The code below shows this usage:
Code:
$.fn.window.defaults.closable = false;  // disable the closable button
$.messager.alert('My Title','Here is a message!');
$.fn.window.defaults.closable = true;  // restore the closable button
Logged
angers
Newbie
*
Posts: 11


View Profile Email
« Reply #4 on: July 01, 2012, 04:18:30 AM »

Very nice workaround. Thank you - I didn't think of this but should have realized it.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!