EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: seonghun9 on November 27, 2017, 12:58:59 AM



Title: $.messager.alert
Post by: seonghun9 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


Title: Re: $.messager.alert
Post by: jarry 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(){
//...
}
})


Title: Re: $.messager.alert
Post by: seonghun9 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  ???



Title: Re: $.messager.alert
Post by: jarry 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')
});


Title: Re: $.messager.alert
Post by: seonghun9 on November 27, 2017, 09:33:27 PM
jarry. Thank you for your reply. ;D