PDA

View Full Version : Icon for Toolbar buttons?



flashape
6 Aug 2010, 12:58 PM
I'm stuck trying to add an icon to a button within a toolbar. I can either get it to show the text or the icon, but not both, even with adding the cls:'x-btn-text-icon' config:


{
xtype: 'button',
text: 'Order Now',
width: 300,
id: 'goshopbutton',
cls:'x-btn-text-icon',
icon:'/images/nav_icons/cart_go.png',
handler: function() {
alert('order now');
}
}

I've also tried adding a custom class after the button was rendererd, but that hasn't worked either.

flashape
6 Aug 2010, 1:38 PM
actually, I cannot get icons in any buttons at all?


dockedItems:[
{
xtype: 'container',
dock: 'top',
layout: { type:'hbox', align:'stretchmax', pack:'center'},
defaults: {
flex:1
},
items: [
{
xtype: 'button',
id: 'goshopbutton',
text:'Order Now',
cls:'x-btn-text-icon',
icon:'/images/nav_icons/cart_go.png',
handler: function() {
alert('order now : ' +this.icon);
}

}]
}