Results 1 to 5 of 5

Thread: no icons from iconCls

  1. #1
    Ext User
    Join Date
    Feb 2008
    Location
    Rostock - Germany
    Posts
    51
    Vote Rating
    0
      0  

    Default no icons from iconCls

    Hy,

    i want to customize an example, but i loose the add/delete Buttons while doing this. I see the buttons and the text, but no images before the text.

    Code:
    ...
    // inline toolbars
            tbar:[{
                text:'Add Something',
                tooltip:'Add a new row',
                iconCls:'add'
            }, '-', {
                text:'Options',
                tooltip:'Blah blah blah blaht',
                iconCls:'option'
            },'-',{
                text:'Remove Something',
                tooltip:'Remove the selected item',
                iconCls:'remove'
            }],
    ...
    in my header i added:
    HTML Code:
    <!-- adding the extjs library -->
    <script type="text/javascript" src="_lib/extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="_lib/extjs/ext-all.js"></script>        
    <link rel="stylesheet" type="text/css" href="_lib/extjs/resources/css/ext-all.css" />  
            
    <!-- adding custom extjs scripts for this page -->
    <script type="text/javascript" src="modules/company/_js/index.js" ></script>
    where is the problem?

  2. #2
    Ext User para's Avatar
    Join Date
    Apr 2007
    Location
    Redmond, WA
    Posts
    918
    Vote Rating
    0
      0  

    Default

    Look at the CSS in the example. The iconCls is just the name of a CSS class, which then gives an image to use. You are probably missing the appropriate CSS.
    Which example are you using?

  3. #3
    Ext User cadudecastroalves's Avatar
    Join Date
    Mar 2007
    Location
    Rio de Janeiro, Brazil
    Posts
    98
    Vote Rating
    1
      0  

    Default

    You must write your own css classes to add these icon classes. Don't forget to add an !important in the end of each class. I'm using the following code in my application:

    Code:
    .home-icon {
    	background-image: url(../images/icons/house.png) !important;
    }
    .form-title-icon {
    	background-image: url(../images/icons/application_form.png) !important;
    }
    .add-icon {
    	background-image: url(../images/icons/add.png) !important;
    }
    Cadu de Castro Alves
    Ext-user
    http://www.cadudecastroalves.com/

  4. #4
    Ext User
    Join Date
    Feb 2008
    Location
    Rostock - Germany
    Posts
    51
    Vote Rating
    0
      0  

    Default

    i use this example:
    extjs/examples/grid/grid3.html
    (the last grid) from the extjs download package

    i looked for a css definition for this images, but i can't find it...
    but now i try again

  5. #5
    Ext User
    Join Date
    Feb 2008
    Location
    Rostock - Germany
    Posts
    51
    Vote Rating
    0
      0  

    Default

    i found it.
    HTML Code:
    .add {
                background-image:url(../shared/icons/fam/add.gif) !important;
            }
            .option {
                background-image:url(../shared/icons/fam/plugin.gif) !important;
            }
            .remove {
                background-image:url(../shared/icons/fam/delete.gif) !important;
            }
    it was not in an external css file. it was in the header of the page.

    thank 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
  •