【发布时间】:2020-05-04 02:40:13
【问题描述】:
我有带有 anyMatch = true 的 ExtJS 标记字段。现在,如果您键入 AB,它将显示结果,一旦您选择选择,它将清除您输入的输入,即 AB 现在当您有 anyMatch=true 时,如果我输入 HI 它会显示结果,但是当您选择值时,输入字段不会被清除。我看到了在 clearInput 方法中显式处理的 ExtJS Tag 字段代码。我想知道为什么以这种方式实施? 下面是示例代码
Ext.create('Ext.form.Panel', {
title: 'Tag Field Example',
width: 1000,
bodyPadding: 10,
items: [{
xtype: 'fieldcontainer',
labelWidth: 100,
layout: 'hbox',
items: [{
xtype: 'fieldcontainer',
defaults: {
flex: 1,
},
layout: 'hbox',
items: [{
xtype: 'tagfield',
minChars: 1,
anyMatch: true,
allowBlank: true,
margin: '5 5 5 5',
fieldLabel: 'Tag Field 1',
name: 'tagField1',
store: ['ABC D', 'EFG HI', 'C'],
queryMode: 'local',
filterPickList: true,
emptyText: 'Multi Select...'
}]
}]
}],
renderTo: Ext.getBody()
});
【问题讨论】: