我不明白为什么使用 Xtemplate 组合框中的项目不再可选择。我可以在 html 代码中看到这些项目没有更多的 internalId。这是我的代码:
Ext.define('app.widget.search.PredictiveInput', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.predictiveinput',
store: 'SearchSyntax',
storeCriteriaSyntax: 'SearchPredictiveInput',
nodeField: 'is_node',
leafField: 'is_leaf',
lastLeafField: 'is_last_leaf',
levelField: 'level',
triggerAction: 'all',
flex: 1,
queryMode: 'local',
displayField: 'subject_display',
valueField: 'id',
pageSize: 10,
setCustomTpl: function() {
var me = this;
me.tpl = Ext.create('Ext.XTemplate',
'<tpl for=".">',
' <div class="x-combo-list-item-isNode-{nodeField}' +
' x-combo-list-item-isLeaf-{leafField}' +
' x-combo-list-item-isLastLeaf-{lastLeafField}' +
' x-combo-list-item-level-{levelField}" role="option">{displayField</div>',
'</tpl>'
);
},
initComponent: function() {
this.callParent();
this.setCustomTpl();
}
});