PDA

View Full Version : Is it possible to show both color and text in a combo box ?



rakesh.mmp
8 Oct 2015, 11:45 PM
Hi,
I want to show both color and text values in a combo box. The colors should be loaded dynamically when I bind a store to the combo box. I am planning to store the color code and text values in a store. I have attached an image as how I want it. Please someone give me some suggestions.

53373

53374

Thanks,
Rakesh

joel.watson
9 Oct 2015, 5:29 AM
Hi--

Absolutely! You can provide a custom template that will be used to display the list items in the drop-down.

Here's an example from the docs (see the "Custom Item Templates"):
http://docs.sencha.com/extjs/4.2.3/#!/example/form/combos.html
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.form.field.ComboBox-cfg-tpl

Thanks!
Joel