Madiyana
10 Nov 2012, 12:10 PM
Hi,
Following example shows normal combobox until I use XTemplate. After applying XTemplatecombobox 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" }
],
listeners : {
'load' : function (store, records, options) {
this.insert(0,'--');
}}
});
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>') }
Following example shows normal combobox until I use XTemplate. After applying XTemplatecombobox 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" }
],
listeners : {
'load' : function (store, records, options) {
this.insert(0,'--');
}}
});
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>') }