Results 1 to 9 of 9

Thread: Chang color of a disabled text field

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default Chang color of a disabled text field

    Hi

    I would like to change the color of textfield when it's disabled. How can I do that?

    Thank you

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    Take a look at the disabledCls config property.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default

    Thank you friend

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default

    Hi
    I tried to do like this*

    Code:
    [{ xtype:
    Code:
    'textfield',
    fieldLabel: 'To',
    name: 'send_to', 
    disabledCls: 'af-item-disabled',
    columnWidth: 1
    }
    ]


    and in css

    .af-item-disabled
    {
    color:#000!important;
    -webkit-text-fill-color: #000!important;
    background-color: Blue!important;
    }
    But it doesn't show the new format. Is there any problem?


  5. #5
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124

    Default

    Hi,
    You can use 'addClass' function of textfield to modify its css even it is disabled

    Code:
    .sampleColorClass{ color:Blue; font-weight:bold; }
    Code:
    yourTextField.addClass('sampleColorClass');
    Also you can remove it according to your needs by using removeClass() method.

    For more details, check this http://docs.sencha.com/ext-js/4-0/#!...ethod-addClass
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default

    Hi Sword-it. Thank you for your answer but maybe you misunderstand my question.

    I want to add disabledCls class but I don't know how to write it in css file. I have tried with the above code but it doesn't have any affect

  7. #7
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    I think this:

    Code:
    background-color: Blue!important;
    Should be this:

    Code:
    background-color: blue !important;

  8. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default

    Thank you friend. you are moderator or user of this forum? I think you have many experience in EXTJS.

  9. #9
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    Just a user, with an Open Source, share-what-you-know mentality...

    :]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •