Extjs 3.4 - Button Icon does not show or does not center

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2012-10-04T09:06:24Z Indexed on 2012/10/04 9:37 UTC
Read the original article Hit count: 186

Filed under:
|
|
|
|

I want to fill a button with an icon I created but whatever I have tried just seems to put the icon either half cut off and way left, or it doesn't show at all. I've been trying different combinations of CSS and the icon, iconcls, cls button options.

I was following the Ext 3 buttons example page but that doesn't seem to display anything for me...

This code is an item inside my form panel (I try to replicate this with different buttons in the panel)
{
                    xtype: 'container',
                    layout: {
                        type: 'table',
                        columns: 2,
                        tableAttrs: {
                            cellspacing: 5
                        }
                    },                  
//                  padding: 5,
                    pack: 'center',
                    align: 'middle',
                    items: [{
                        xtype: 'button',
                        width: 40,
//                      scale: 'medium',
                        ref: '../drawToolsBtn',
                        tooltip: 'Drawing Tools',
                        icon: 'img/draw.png',
                        iconAlign: 'top',
                        baseCls: 'x-plain',
//                      iconCls: 'drawBtn',
                        enableToggle: true,
//                      padding: 3,
                        toggleHandler: function(btn, state)
                        {
                            this.showDrawToolsWin(state);
                        },
                        scope: this
                    },{
                        xtype: 'label',
//                      columnWidth: 1, // remainder of container
                        padding: 3,
                        text: 'Click button to open Drawing Tools Menu'
                    }]
                }


CSS
--------------------
.drawBtn{
    background: url(../img/draw.png) !important;


}

Thank you for any help!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html