PDA

View Full Version : Combobox and XTemplate in default config



Oliver Specht
18 Feb 2015, 3:04 AM
Hi,
I am trying to override the default combobox tpl like this (4.1.1a):



listConfig: {
width: 240,
tpl: [
'<tpl for=".">',
'<div data-qtip="{[this.displayField]}" data-qtitle="">',
'<div role="option" class="wrapit x-boundlist-item" width="100%">{[this.displayField]}</div>',
'</div>',
'</tpl>'
]
}

This all happens in the "default" config for the comboboxes which I want to add to a panel which is located in the initComponent() call.

As far as I know the {[]} syntax makes it possible to use code to be executed in the template but the combobox list shows nothing empty strings.

Can anyone push me in the right direction?

joel.watson
28 Feb 2015, 10:46 AM
Hi--

In your example, "this" is going to be the XTemplate itself. Check out the default example from boundlist:



me.tpl = new Ext.XTemplate(
'<tpl for=".">',
'<li role="option" unselectable="on" class="' + itemCls + '">' + me.getInnerTpl(me.displayField) + '</li>',
'</tpl>'
);


Thanks
Joel