ankitg
ankitg

Reputation: 123

Sencha Touch: how to change the color of selectfield using css?

Do we have any specified css for coloring the selecfield in sencha touch2?

My selectfield code as of now is as follows:

{
    xtype: 'selectfield',
    options: [
    {text: 'AI',  value: 'first'},
    {text: 'AK', value: 'second'},
    {text: 'BR',  value: 'third'}
    ]
}

Upvotes: 0

Views: 3078

Answers (2)

Sudip
Sudip

Reputation: 2051

You can use a separate css class for your select field. Use " css: 'yourclassname' " after your "xtype" value and define the class as

.yourclassname{ background-color:#000;color:#fff;font:normal 12px Arial;}

So your code will be

              xtype: 'selectfield',
              cls:  'yourclassname',
              options: [
                        {text: 'AI',  value: 'first'},
                        {text: 'AK', value: 'second'},
                        {text: 'BR',  value: 'third'}
                        ]

thanks

Upvotes: 3

Dmytro Plekhotkin
Dmytro Plekhotkin

Reputation: 1993

Please check: http://docs.sencha.com/touch/2-0/#!/guide/theming

Using Sass & Compass is the right way for styling your app!

Upvotes: 0

Related Questions