EasyUI Forum
May 01, 2024, 10:17:43 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: Better way to change Icon for messager.confirm ?  (Read 9251 times)
2plus2
Jr. Member
**
Posts: 75


View Profile
« 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?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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: ...;
}
Logged
2plus2
Jr. Member
**
Posts: 75


View Profile
« Reply #2 on: March 31, 2014, 06:03:40 PM »

var win = ....

Ah, yes. Thanks.
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!