Folloving example shows normal combobox until I use XTemplate. After applying XTemplate combobox items become unclickable (no highlight on hover and no choosing by click).
Ext.onReady(function () {
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data: [
{ "abbr": "AL", "name": "Alabama" },
{ "abbr": "AK", "name": "Alaska" },
{ "abbr": "AZ", "name": "Arizona" }
]
});
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
renderTo: 'divId',
tpl: new Ext.XTemplate(
'<tpl for="."><div class="x-combo-list-item">{name}</div></tpl>')
});
}
The default
XTemplatefor ComboBox is:You already have set the
displayFieldto name, so why would you need a custom template?