afsarnamak
afsarnamak

Reputation: 11

how to add colours as values to combobox in extjs 4.2

my requirement is to have colours in combo box instead of textual value as "RED", "GREEN" in dropdown. am trying to achieve this using EXTJS 4.2. Could any one please help me how to configure the combobox.

is there any way to add colour images as values to combobox.

Upvotes: 1

Views: 1660

Answers (3)

mindparse
mindparse

Reputation: 7225

You should use listConfig config to change the behaviour of combobox picker. (For more information: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.ComboBox-cfg-listConfig)

Upvotes: 1

Abylay Sabirgaliyev
Abylay Sabirgaliyev

Reputation: 726

It can be done by setting 'background-color: color; background-image: none;'

Take look at this expamle

Upvotes: 0

Daniël Camps
Daniël Camps

Reputation: 1809

Perhaps you give the combobox element a css class (e.g. 'foo'), or style tag, and then set the background-color with CSS

.foo{
background-color: red
}

Upvotes: 0

Related Questions