1. #1
    Ext User
    Join Date
    Jul 2010
    Posts
    10
    Vote Rating
    0
    miwe76 is on a distinguished road

      0  

    Default Chang Background color of a textarea is not possible

    Chang Background color of a textarea is not possible


    Hello with GXT 2.0 i changed the background color of a textarea with following example:
    textarea.setStyleAttribute("background-color", "#B0C4DE");

    with GXT 2.2 the background color is not changed anymore....
    in need a method like this:
    textarea.setInputStyleAttribute("background-color", "#B0C4DE");
    But this isnt in the API the background color only white.

    Thanks for help

    Michael

  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


    This is not a bug. Please read the bugforum guidelines.

    I suggest you inspect the element with firebug and you will figure it out quite fast

  3. #3
    Ext User
    Join Date
    Jul 2010
    Posts
    10
    Vote Rating
    0
    miwe76 is on a distinguished road

      0  

    Default


    Yes i use firebug.
    There is a css class on the textarea with the name: x-form-field AND x-form-textarea
    ic created my own css class:
    .textarea-readonly{
    background: #B0C4DE;
    color: #000000;
    cursor: default !important;
    }

    i add it with textarea.addInputStyleName("input-readonly");

    but its still white
    When its not a bug, what is the right method name to change the background?

    Micha

  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


    input-readonly != textarea-readonly

    Also firebug will tell you exactly why it is not working.

  5. #5
    Ext User
    Join Date
    Jul 2010
    Posts
    10
    Vote Rating
    0
    miwe76 is on a distinguished road

      0  

    Default


    sorry,
    it is
    textarea.addInputStyleName("textarea-readonly");

    Yes firebug tells me that the other css classes say this:
    .x-form-text, textarea.x-form-field {
    background-color:#FFFFFF;
    background-image:url("../images/default/form/text-bg.gif");
    border-color:#B5B8C8;
    }

    so i tried out

    textarea.removeInputStyleName("x-form-text");
    textarea.removeInputStyleName("textarea.x-form-field");

    but this changes nothing....
    What method of the textarea removes default css classes or changes my background color?
    Last edited by miwe76; 26 Jul 2010 at 6:08 AM. Reason: Add

  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


    So there is probably another rule that is higher and overrides yours.

    You can either add the !important flag to your css, or change the rule to eb higher than the other. All this is basic css.

Similar Threads

  1. Chang background color in a tooltip
    By tkirkham in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 22 Aug 2014, 6:35 AM
  2. Background color of textarea
    By jplouffe in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 12 May 2014, 1:16 AM
  3. Replies: 2
    Last Post: 12 Apr 2009, 5:52 PM

Thread Participants: 1