1. #1
    Ext User
    Join Date
    Feb 2008
    Location
    Rostock - Germany
    Posts
    51
    Vote Rating
    0
    fellfresse is on a distinguished road

      0  

    Default no icons from iconCls

    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
    -2
    para has a little shameless behaviour in the past

      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
    0
    cadudecastroalves is on a distinguished road

      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
    fellfresse is on a distinguished road

      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
    fellfresse is on a distinguished road

      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!

Thread Participants: 2