EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: 2plus2 on March 28, 2014, 01:36:08 PM



Title: Better way to change Icon for messager.confirm ?
Post by: 2plus2 on March 28, 2014, 01:36:08 PM
Howdy...

We want to change the messager.confirm icon to "warning". Since there is no parameter for that (enhancement hint :-) we do the following:

Code:
$.messager.confirm('Title Text Here', 'Message Text Here', function ( r ) {
   ... blah blah blah...
   }
});
$('.messager-icon, .messager-question').removeClass('messager-question').addClass('messager-warning');

Because we only have on confirm dialog on this page, that works. But we are looking for a better solution. Ideas?


Title: Re: Better way to change Icon for messager.confirm ?
Post by: stworthy on March 28, 2014, 06:31:32 PM
The code is similar to yours.
Code:
var win = $.messager.confirm('My Title', 'Are you confirm this?', function(r){
if (r){
alert('confirmed: '+r);
}
});
win.find('.messager-icon').removeClass('messager-question').addClass('messager-warning');

Another way is to change the background image of '.messager-question' CSS definition.
Code:
.messager-question {
  background: ...;
}


Title: Re: Better way to change Icon for messager.confirm ?
Post by: 2plus2 on March 31, 2014, 06:03:40 PM
var win = ....

Ah, yes. Thanks.