PDA

View Full Version : Toolbar button backgroup image.



muncher
6 Aug 2010, 9:59 AM
How to fill the button with an image ?

my current code -



.....
tbar : [
{
icon: './icons/x-logo.jpg'
},
....



produces icon kind of in the button. I want it to be filled entirely by that.

Condor
7 Aug 2010, 3:50 AM
Ext.Button won't do that (it has it's own styling with borders).

Maybe you should use a simple BoxComponent, e.g.

{
xtype: 'box',
width: 30,
height: 30,
autoEl: '../icons/x-logo.jpg',
listeners: {
render: function(c){
c.getEl().on({
click: function(e){
// do stuff
},
scope: c
});
}
}

muncher
7 Aug 2010, 1:45 PM
Yup, I did look that up. It works.

Thanks.