Results 1 to 4 of 4

Thread: button image width problem

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    15
    Vote Rating
    0
      0  

    Default Unanswered: button image width problem

    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?

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,747
    Answers
    130
    Vote Rating
    129
      0  

    Default

    take a look at:
    http://docs.sencha.com/ext-js/4-0/#!...tton-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.
    Best regards
    Tobias Uhlig

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    15
    Vote Rating
    0
      0  

    Default

    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.

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,790
    Answers
    583
    Vote Rating
    390
      0  

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •