In my combobox i have something like this:
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'{Nome} ({Valor})',
'</tpl>')
It works fine except that if there isn't a pre-selected value for the combo, it shows this "()"
So i've tried to create a template that when the value is empty then it show nothing like this:
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<tpl if="this.isEmpty({Nome})">',
'',
'<tpl else>',
'{Nome} ({Valor})',
'</tpl>',
'</tpl>',
{
isEmpty: function (value) {
return value == '';
}
})
But i keep getting a error message "Expected :" when the tpl is evaluated (extjs-all-debug)
compile: function (tpl) {
var me = this,
code = me.generate(tpl);
return me.useEval ? me.evalTpl(code) : (new Function('Ext', code))(Ext);
Any ideas on how to do this?