EasyUI Forum
March 28, 2024, 02:54:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Poll
Question: $.messager.alert OK Button Event
$.messager.alert - 1 (33.3%)
$.messager.alert OK Button - 2 (66.7%)
Total Voters: 3

Pages: [1]
  Print  
Author Topic: $.messager.alert  (Read 10951 times)
seonghun9
Newbie
*
Posts: 5


View Profile Email
« on: November 27, 2017, 12:58:59 AM »

I want to give focus after pressing the $.messager.alert() function OK button.

However, when you click the OK button, focus disappears.

I know I can give an event to $.messager.confirm() function.

but I want to give an event when the OK button is pressed on the $.messager.alert() function.

$.messager.alert() function Can I give an event to the OK button? (I want to give focus event after pressing OK button)

If I can not give an event to the OK button in $ .messager.alert(), can I delete the cancle button in $ .messager.confirm() function?

thanks for reading
« Last Edit: November 27, 2017, 01:16:34 AM by seonghun9 » Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 on: November 27, 2017, 06:32:30 PM »

The 'fn' is the callback function when clicking the 'OK' button on the alert dialog.
Code:
$.messager.alert({
title: 'Alert',
msg: 'The alert message.',
fn: function(){
//...
}
})
Logged
seonghun9
Newbie
*
Posts: 5


View Profile Email
« Reply #2 on: November 27, 2017, 07:07:21 PM »

jarry. Thank you for your reply. But the problem has not been solved.

It is my source

function toUpper(ev, str) {
      
$.messager.alert({
     title: 'Warning',
     msg: 'Error.',
     fn: function(){
         alert("OK");
     }
});

}

See the photo I attached

The alert window pops up. But the title, msg, and fn functions do not work  Huh

« Last Edit: November 27, 2017, 07:11:51 PM by seonghun9 » Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #3 on: November 27, 2017, 07:25:13 PM »

If you are using a lower version of EasyUI, please try this code instead.
Code:
$.messager.alert('My Title','Here is a message!',null,function(){
alert('ok')
});
Logged
seonghun9
Newbie
*
Posts: 5


View Profile Email
« Reply #4 on: November 27, 2017, 09:33:27 PM »

jarry. Thank you for your reply. Grin
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!