EasyUI Forum
May 02, 2024, 06:33:58 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: escape from messager.confirm  (Read 5122 times)
korenanzo
Guest
« on: April 29, 2016, 01:25:02 AM »

Hi,

when using messager.confirm you have a message and two  (OK Cancel) buttons;
in the callback function I can test the result, that is which button the user has pushed;

problem is that the user can escape from the window using the X icon or the ESC key

In this case the callback function is NOT called and the programmer can loose the control.

I'd like to remove the "X" tool icon and change  the ESC behaviour, is it possible?
thanks, RIc
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: April 29, 2016, 05:59:13 AM »

When close the message window, the 'onClose' event fires. If you click the 'Ok Cancel' buttons, the callback function 'fn' will be called. If you press ESC key, only the 'onClose' event fires.
Code:
$.messager.confirm({
title:'Title',
msg:'message.',
closable:false,
onClose:function(){
console.log('onClose')
},
fn:function(r){
console.log(r)
}
})
Logged
korenanzo
Guest
« Reply #2 on: April 29, 2016, 07:58:55 AM »

thank you Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!