1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    13
    Vote Rating
    0
    anhkpb is on a distinguished road

      0  

    Smile Change icon of button

    Change icon of button


    Hi,

    I have a button

    var bnormal = new Ext.Button({
    text: 'History',
    iconCls:'x-item-normal',
    handler: function(btn, pressed){
    }
    });

    I want to change the iconCls of its when click or some where.

    Could tell me how to do.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    call setIconClass?

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    13
    Vote Rating
    0
    anhkpb is on a distinguished road

      0  

    Default Change icon of button

    Change icon of button


    Thanks

  4. #4
    Sencha User
    Join Date
    Oct 2014
    Posts
    7
    Vote Rating
    0
    pepeEL is on a distinguished road

      0  

    Default


    Hello
    I am beginner. I have a TV server with button to show passwords. This button have icon named 'eye' which is savev in ext.css:
    .eye {
    background-image: url(../icons/eye.png) !important;
    }

    Code button in idnode.js is:

    if (conf.hidepwd) {
    buttons.push('-');
    abuttons.add = new Ext.Toolbar.Button({
    tooltip: 'Show or hide passwords',
    iconCls: 'eye',
    text: 'Show passwords',
    disabled: false,
    handler: function() {
    conf.showpwd = !conf.showpwd ? true : false;
    this.setText(conf.showpwd ? 'Hide passwords' : 'Show passwords');
    roweditor_destroy();
    roweditor(select.getSelected());
    }
    });
    buttons.push(abuttons.add);
    }


    I wnat changed icon for this:
    .showPass{
    background-image: url(../icons/show_pass.png) !important;
    }

    .hidePass{
    background-image: url(../icons/hide_pass.png) !important;
    }


    When button have text Show password the icon must be: show_pass.png
    When button have text Hide password the icon must be: hide_pass.png

    Please help me how changed the code of button to work with this double icon.

Thread Participants: 2