Akshatha
Akshatha

Reputation: 319

How to change the color of the selected value of Select Field in sencha?

How to change the color of the selected value of Select Field in sencha? It appears grey by default.

                {

                    xtype: 'selectfield',
                    ui: 'text',
                    value : 12,
                    cls:'b',
                    style: {
                        'font-size':'12px',
                    },
                    options: belts
                },

and in my app.scss i have:

.b
{
color:black !important;
 }

I have also tried:

                {

                    xtype: 'selectfield',
                    ui: 'text',
                    value : 12,
                    cls:'b',
                    style:  'font-size:12px;color:black',
                    options: belts
                },

Can anyone please help me?

Upvotes: 2

Views: 1664

Answers (2)

Yash Vekaria
Yash Vekaria

Reputation: 2373

Just try this way :-

{
  xtype: 'selectfield',
  label: 'Choose one',
  inputCls:'selecttext',
  options: [
             {text: 'First Option',  value: 'first'},
             {text: 'Second Option', value: 'second'},
             {text: 'Third Option',  value: 'third'}
           ]
}

In css make class

.selecttext{
   color: #f25454 !important;
   -webkit-text-fill-color:#f25454 !important;
   background-color: #2d2d2d;
}

Upvotes: 0

Akshatha
Akshatha

Reputation: 319

I actually wanted the text to appear in black. Changing

ui:'text' 

to

ui:'plain'

helped me solve this issue.

Upvotes: 1

Related Questions