Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TextItem Font color when disabled

    SmartGWT ver: 2.3
    Browser: IE 7.0.5730

    Hi,
    How do I change the font color of a TextItem when it is disabled?
    I have used this in my java code:
    Code:
    txtItem.setTextBoxStyle("locTextItem");
    txtItem.setDisabled(true);
    txtItem.setTitle("Location");
    txtItem.setValue("New York");
    CSS code:
    Code:
    .locTextItem,
    .locTextItemFocused,
    .locTextItemError,
    .locTextItemHint {
        padding:2px;
        border:1px solid #898d96;
        background:#FFFFFF;
        color:#333333;
        font-family:Arial,Verdana,sans-serif; 
        font-size:12px;
    }
    .locTextItemDisabled {
        padding:3px;
        border:0px solid #898d96;
        background:#FFFFFF;
        font-family:Arial,Verdana,sans-serif; 
        color:red;
        font-size:12px;
    }
    The padding, border, font-family, and font-size works and being applied to the TextItem except for the "color". It still remains as grey. How do I change the font color?

    Thanks!

    #2
    ok, I had work around on this one...

    instead using :

    txtItem.setDisabled(true);
    txtItem.setTextBoxStyle("locTextItem");

    I used:

    txtItem.setAttribute("readOnly",true);
    txtItem.setTextBoxStyle("locTextItem");

    I got the idea from this Thread
    http://forums.smartclient.com/showthread.php?t=8483

    Comment

    Working...
    X