私のコンボボックスには、次のようなものがあります。
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'{Nome} ({Valor})',
'</tpl>')
コンボに事前に選択された値がない場合は、この「()」が表示されることを除いて、正常に機能します。
だから私は、値が空のときに次のようなものが何も表示されないテンプレートを作成しようとしました:
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<tpl if="this.isEmpty({Nome})">',
'',
'<tpl else>',
'{Nome} ({Valor})',
'</tpl>',
'</tpl>',
{
isEmpty: function (value) {
return value == '';
}
})
しかし、tplが評価されると「Expected:」というエラーメッセージが表示され続けます(extjs-all-debug)
compile: function (tpl) {
var me = this,
code = me.generate(tpl);
return me.useEval ? me.evalTpl(code) : (new Function('Ext', code))(Ext);
これを行う方法についてのアイデアはありますか?