PDA

View Full Version : Combobox + XTemplate trouble



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>') }

skirtle
10 Nov 2012, 12:19 PM
Please stop posting the same question over and over again. You've asked this at least 4 times now.

Please post any follow up to the following thread:

http://www.sencha.com/forum/showthread.php?248668