PDA

View Full Version : button image width problem



nixerella
28 Feb 2012, 5:05 AM
I'm new to this and using 4.0.6. I have a panel with 9 image buttons on (3 x 3 - I'm getting them in rows by restricting the width of the panel which is probably bad but am open to other ideas). Each image is 22px by 22px. I'm using iconCls:"myClass" and myClass in css is a background image with a url and !important.

The button doesn't display the full image - it looks as if it has sort of slid off the edge a bit. I read somewhere to try using cls:"myClass" instead of iconCls, but that results in blank buttons in IE8. Do I need to specify the widths in the button config in order to get this to work? Or if not, what?

tobiu
28 Feb 2012, 5:16 AM
take a look at:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.button.Button-cfg-scale

there are 3 scales available, the default one is small optimized for 16px icons. medium will fit better with 24px.

if you want exactly 22px, you would probably do best defining an own scale to achieve this.

nixerella
28 Feb 2012, 6:22 AM
medium scale isn't bad but I think I need exactly 22 (all the buttons together form a picture). So if I called my scale "smallMedium" how do I define the css? I can see some classes in firebug but can't quite get it right - getting a blank button again.

skirtle
28 Feb 2012, 11:27 AM
I think you'd be better to approach this using Sass rather than CSS. There are a lot of subtle things going on in that CSS that the button Sass will handle for you.