1. #1
    Ext User
    Join Date
    Sep 2010
    Posts
    14
    Vote Rating
    0
    gnonide is on a distinguished road

      0  

    Default [Doubt] Gxt and CSS attribute names

    [Doubt] Gxt and CSS attribute names


    I would like to now why Gxt uses different attribute names for css, and if there is a list with the equivalents between CSS default names and Gxt attribute names.

    For example, to set the background color of some component I use background-color: #000000; but in the code I need to do component.setStyleAttribute("backgroundColor", "#000000"); for it to work.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    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


    It should also work with component.setStyleAttribute("background-color", "#000000"); in GXT 2.2 and probably earlier.

    I just tested it and it works for me.

  3. #3
    Ext User
    Join Date
    Sep 2010
    Posts
    14
    Vote Rating
    0
    gnonide is on a distinguished road

      0  

    Default


    Oh yeah, you're right. But when I use component.setStylePrimaryName("my-style"); with the property on it, the color just don't get loaded to the page's css.

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    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


    Have you inspected the output with firebug? Is the stylename "my-style" really assigned? Do you have a css rule that matches ".my-style"?

  5. #5
    Ext User
    Join Date
    Sep 2010
    Posts
    14
    Vote Rating
    0
    gnonide is on a distinguished road

      0  

    Default


    Yeah, I've already done this, but the problems persists, it looks like everytime I use a Gxt component with my customized style, it won't work, even if I put an !important in the front of my attribute declaration.

  6. #6
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    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


    Which component are yu using? Setting the backgroundcolor on the most outer element of a ContentPanel for example wont change anything.

    Firebug will exactly tell you which element you need to style.

  7. #7
    Ext User
    Join Date
    Sep 2010
    Posts
    14
    Vote Rating
    0
    gnonide is on a distinguished road

      0  

    Default


    It's a LayoutContainer.

  8. #8
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    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


    Should work there. Can you please upload your compiled application somewhere so i can access it over http?

Similar Threads

  1. CSS.UpdateRule and Capitilization of selectors/class names
    By willgillen in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 4 Sep 2009, 10:28 AM
  2. change css attribute !!!
    By neerajnandwana in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 20 Aug 2009, 2:39 AM
  3. change css attribute !!!
    By neerajnandwana in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 20 Aug 2009, 12:41 AM
  4. Changing the css attribute of a particular column
    By coriolis in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 7 Jun 2009, 12:02 AM
  5. documentation for which CSS class names are assigned to which elements?
    By daveh0 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 16 Jan 2009, 4:18 AM

Thread Participants: 1