EasyUI Forum
April 28, 2024, 02:41:46 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: adding custom buttons to $.messager  (Read 14927 times)
korenanzo
Guest
« on: October 15, 2014, 08:40:21 AM »

Hi,

Is it possible to add custom buttons to $.messenger ?
Something like:
$.messager.show({
   title:'My Title',
   msg:'Tell me what do you want I sould do.',
   showType:'show',
   buttons:{'Delete all', 'Select all','choose something','forget it'}
});
I know that I could do it with $.dialog but I'd like something more swift .

Thanks,
Ric
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 15, 2014, 07:11:27 PM »

Please refer to this example http://jsfiddle.net/wmo55c7q/.
Logged
korenanzo
Guest
« Reply #2 on: October 16, 2014, 01:08:38 AM »

Very nice Smiley

Now, what about the icon? is it possible to add it ,too, or is it possible to add the custom buttons to messager.alert?

thanks again,
RIc
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: October 16, 2014, 01:44:11 AM »

Similar to the previous example, you can add any components to the window footer.
Logged
korenanzo
Guest
« Reply #4 on: October 16, 2014, 02:29:42 AM »

I'd like to put the icon aside  the body text, just like in
$.messager.alert('My Title','Here is a question message!','question');

and I'd like to use the same images available for the alert.
To do this, I think I'd to override the body, not the footer.. ??
Logged
korenanzo
Guest
« Reply #5 on: October 21, 2014, 03:39:58 AM »

I'd like to put the icon aside  the body text, just like in
$.messager.alert('My Title','Here is a question message!','question');

and I'd like to use the same images available for the alert.
To do this, I think I'd to override the body, not the footer.. ??
so, nobody ??

well, self-answer:
just add to the msg:
<div class="messager-icon messager-info"></div>

obtaining something like this:
$.messager.show({
   title:'My Title',
   msg:'<div class="messager-icon messager-info"></div> Tell me what do you want I sould do.',
   showType:'show',
   buttons:{'Delete all', 'Select all','choose something','forget it'}
});

If someone has found  a better solution... please share Smiley

RIc
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!