1
votes

I'm having trouble adding a mailto: link to a grid panel's toolbar.

I've tried modifying the object's HTML configuration & also via the handler but neither are opening the new email message.

{
text   : 'Support', 
html: '<a href="mailto:[email protected]" target="_blank">Support</a>'
}


{
text   : 'Support', 
handler: function() {
   return '<a href="mailto:[email protected]">Support</a>';
}
3

3 Answers

2
votes

handler: is used to create handler function of button pressed. To make your mailto link work you should redirect to mailto:[email protected] address like:

handler: function() {
    window.location = 'mailto:[email protected]';
}
0
votes

I would do as @webbandit suggested, except I would use window.open('mailto:address.com')

0
votes

If you are using ExtJS 4.x, you can define it in href:

{
    text : 'Support', 
    href : "mailto:[email protected]"
 }

hrefTarget="_blank" is default value, but it is better if you set it to _self:

{
    text : 'Support', 
    href : "mailto:[email protected]",
    hrefTarget: "_self"
 }