Results 1 to 2 of 2

Thread: Image in Button

  1. #1
    Ext User
    Join Date
    Sep 2009
    Posts
    55

    Default Image in Button

    Can anyone explain how to get the image associated with a Button to expand to fill the whole button? I tried (a) screwing around with the properties of the .GIF file itself, (b) using 'iconCls' instead of 'icon', (c) looking at and adjusting Button properties. Any help appreciated.

    Code:
    <html>
    <head>
        <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"/>
        <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
        <script type="text/javascript" src="extjs/ext-all.js"></script>
        <style type="text/css">
            .gregicon {
                background-image:url('icons/image1.gif');
            }        
        </style>
        <script type="text/javascript">
            Ext.onReady(function() {
                
                var wtf = new Ext.Button({
                    height: 35,
                    icon: 'icons/image1.gif',
                    //iconCls: '.gregicon', // commenting the previous line and uncommenting this one does not help
                    width: 35
                });
                
                var viewport = new Ext.Viewport({
                    items:[wtf],
                });
                
            });
        </script>
    </head>
    <body>
    
    </body>
    </html>

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    scale:'large' will make the icon 32x32px.

    If you want something other than 16x16px (small), 24x24px (medium) or 32x32px (large) then you'll have to define your own scale value and add the appropriate css rules.

Posting Permissions

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