Hybrid View

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    31
    Answers
    2
    Vote Rating
    1
    billsalvucci is on a distinguished road

      0  

    Default Answered: Making simple css changes without implementing Appearance

    Answered: Making simple css changes without implementing Appearance


    I was hoping to layout my application using uibinders and then hand things off to a css person to make some small tweaks. I was planning on adding a styleName to all the things that will need css tweaks, so the css person would just fill in css for the corresponding css classes.
    But it appears that when I set the styleName, it wipes out all the styles from the theme appearances. I just want to add my own styleName. There used to be a addStyleName, but it is no longer available in 3.0.1

    I feel that having to implement Appearance for everying is overkill for what I need to do. And I have to expend considerable java resources to do it.

    Am I missing how I can make small css changes?

  2. Instead of setStyleName(String), which replaces the css classes as you've noted, use addStyleName(String). This will append to the existing set of classes.

    Element also has addClassName(String), for the same basic feature.

  3. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Instead of setStyleName(String), which replaces the css classes as you've noted, use addStyleName(String). This will append to the existing set of classes.

    Element also has addClassName(String), for the same basic feature.

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    31
    Answers
    2
    Vote Rating
    1
    billsalvucci is on a distinguished road

      0  

    Default


    I was looking for addStyleName in the GXT javadocs, but I now see that it is a special property of GWT.

    This works

    <container:BorderLayoutContainer addStyleNames="foo">
    results in
    class='GP34Q33HEC-com-sencha-gxt-theme-gray-client-container-GrayBorderLayoutAppearance-GrayBorderLayoutStyle-container foo'


    Thanks!

  5. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Its a 'special' property insofar as we inherit from Widget (which inherits from UIObject). When looking for methods in JavaDocs or in the source itself, make sure to look through the superclasses - I find it is usually easier to start with an instance of the object in Java and use my IDE's autocomplete to see what is available at all levels.

Thread Participants: 1