View Full Version : Can't get icon to show for button?

15 Jul 2010, 7:43 AM
I have tried it a couple of different ways with no success. Does anyone know what I am missing?

items: [{
xtype: 'button',
iconCls: 'testclass',
text: 'my test button',
icon: '/prototype2/images/News2_128x128.png'
}, {
xtype: 'button',
ui: 'round',
text: 'Round'

15 Jul 2010, 11:02 AM
I'm in a similar boat. I just get a big square instead of my image when I try to set the iconCls to something custom in a tab panel item. Anybody know why? Is it even possible to do this?

17 Jul 2010, 11:23 AM
I was confused as well, but looked at the bottom tab demo source to see what they were doing, so:

In your css:
.x-tab img.home{-webkit-mask-box-image:url('../img/tabicons/home.png');}

And in your js, use the iconCls='home' when constructing your tab panel.

In the css of the demo, they are writing out the image data itself (data:image/png;base64,iVBORw0KGgoAAAANS......) I'm not sure why they are doing this, maybe due to a rendering issue from the milliseconds it would take to display a local image? IDK.