EasyUI Forum

General Category => General Discussion => Topic started by: korenanzo on October 15, 2014, 08:40:21 AM



Title: adding custom buttons to $.messager
Post by: korenanzo 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


Title: Re: adding custom buttons to $.messager
Post by: stworthy on October 15, 2014, 07:11:27 PM
Please refer to this example http://jsfiddle.net/wmo55c7q/.


Title: Re: adding custom buttons to $.messager
Post by: korenanzo on October 16, 2014, 01:08:38 AM
Very nice :)

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


Title: Re: adding custom buttons to $.messager
Post by: stworthy on October 16, 2014, 01:44:11 AM
Similar to the previous example, you can add any components to the window footer.


Title: Re: adding custom buttons to $.messager
Post by: korenanzo 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.. ??


Title: Re: adding custom buttons to $.messager
Post by: korenanzo 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 :)

RIc