mercredi 18 février 2015

Combobox and XTemplate in default config

Hi,

I am trying to override the default combobox tpl like this (4.1.1a):

Code:



displayTpl : new Ext .XTemplate(
'<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 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 entry shows a broken html snippet on selection.


Can anyone push me in the right direction?


PS: Previous version was this:



Code:



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

and I wanted to avoid the {name} part and make it more dynamic...



Combobox and XTemplate in default config

Aucun commentaire:

Enregistrer un commentaire