1. #1

    Default [GXT 2.0 m3] Pb with setIconStyle

    Hi,
    Just upgraded to 2.0-m3 and saw that the setIconStyle method on a Button doesn't add the class to my button element (in the generated Html) anymore.
    Code:
    Button excelButton = new Button();
    excelButton.setText(buttonLabel);
    excelButton.setIconStyle("excel-button");
    It was working with 2.0-m2.

    Thanks,
    Jean-Marie

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,974
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default

    This is not a bug. I will move this to the help forum. SetIconStyle only sets the icon.

    If you want a stylename, you have to use addStyleName

  3. #3

    Default

    Quote Originally Posted by sven View Post
    If you want a stylename, you have to use addStyleName
    This doesn't work either.

  4. #4
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,974
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default

    You should probably explain what you are doign with this css rule.

  5. #5

    Default

    I recompiled my code -without changing aything- with the 2.0-m2, and both setIconStyle and addStyleName are working.
    So I confirm that this seems to be a bug in the 2.0-m3 version.
    If I'm wrong, tell me why.

    This is what I'm doing :
    Code:
    Button excelButton = new Button();
    excelButton.setText(buttonLabel);
    excelButton.setIconStyle("excel-button");
    excelButton.addSelectionListener(...);
    ToolBar toolbar = new ToolBar();
    toolbar.add(excelButton);
    this.setTopComponent(toolbar);
    And whatever I put in my CSS, the excel-button class isn't applied to the button :
    Code:
    <button class="x-btn-text" ...>
    Thanks.

  6. #6
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,974
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default

    addStyleName is not appliying anything to the button element. It is applying something to the main element. You need to update your css rules according to that. setIconStyle is only for setting an icon (this was also documented)

  7. #7

    Default

    Ok.
    My rule was :
    Code:
    button.excel-button {...}
    I needed to prefix it with button with the 2.0-m2 version, to override other gxt rules, 'cause the class was applied to the button element.
    And now -in the 2.0-m3- I agree, not anymore.
    Thanks anyway.
    Jean-Marie

Thread Participants: 1