View Full Version : Combobox listConfig

17 Sep 2012, 11:56 PM

listConfig : { selectedItemCls: 'my-item-selected-class'
in ComboBox configuration doesn't work. Css class remain x-boundlist-selected.
Why? It's a bug?

18 Sep 2012, 8:32 AM
Please provide a small working example of what you are trying to achieve.


18 Sep 2012, 1:37 PM
Hi Scott,
this is my simple combobox:

var myPhone = new Ext.form.field.ComboBox({
store: [[1,'iPhone'],[2,'Home'],[3,'Cell'],[4,'Office']],
width: 60,
editable: false,
hideTrigger: true,
listConfig : {
selectedItemCls: 'item-selected-phone'
value: 1

I need only to customize the Css class of selected item in the combobox.

Api of Ext.form.field.ComboBox:
listConfig (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.ComboBox-cfg-listConfig) : Object (http://docs.sencha.com/ext-js/4-1/#!/api/Object)6
An optional set of configuration properties that will be passed to the Ext.view.BoundList (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList)'s constructor. Any configuration that is valid for BoundList can be included. Some of the more useful ones are:

cls (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-cls) - defaults to empty
emptyText (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-emptyText) - defaults to empty string
itemSelector (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-itemSelector) - defaults to the value defined in BoundList
loadingText (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-loadingText) - defaults to 'Loading...'
minWidth (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-minWidth) - defaults to 70
maxWidth (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-maxWidth) - defaults to undefined
maxHeight (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-maxHeight) - defaults to 300
resizable (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-resizable) - defaults to false
shadow (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-shadow) - defaults to 'sides'
width (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.BoundList-cfg-width) - defaults to undefined (automatically set to the width of the ComboBox field if matchFieldWidth (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.ComboBox-cfg-matchFieldWidth) is true)
Available since: Ext 4

Api of Ext.view.BoundList:
selectedItemCls (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.view.AbstractView-cfg-selectedItemCls) : String (http://docs.sencha.com/ext-js/4-1/#!/api/String)2
A CSS class to apply to each selected item in the view.
Defaults to: Ext.baseCSSPrefix + 'item-selected'
Available since: Ext 4

19 Sep 2012, 1:59 AM
I experienced a similar behavior where the overItemCls configuration is ignored. The deprecated overCls works fine, but gives the deprecation warning.

emptyText:'No matching entities found.',
overCls : 'combobox_highlight', // works .. but gives warning ..
overItemCls : 'combobox_highlight', // doesn't work