使用 ExtJS 4.2.1,当用户开始在组合的输入字段中输入时,您将如何编写一个“组合”框来查询displayField而不是 valueField?
以下是我对 ComboBox 的设置:
xtype: 'combo',
itemId: 'usersCbo',
width: 450,
forceSelection: true,
fieldLabel: 'Assign Selected TestRuns To',
labelAlign: 'right',
labelWidth: 180,
queryMode: 'local',
valueField: 'USERNAME',
displayField: 'FULLNAMES',
triggerAction: 'all',
typeAhead: true,
allowBlank: false,
store: Ext.create('Ext.data.Store', {
storeId: 'testRunUsersStore',
autoLoad: true,
pageSize: 1000,
proxy: {
type: 'ajax',
url: 'app/php/stores/Test_Run/testEngineers.php',
reader: {
type: 'xml',
record: 'Record',
root: 'Records',
totalProperty : '@totalRecords'
}
},
fields: [
{ name: 'USERNAME', type: 'string' },
{ name: 'FULLNAMES', type: 'string' }
],
sortOnLoad: true,
sorters: { property: 'USERNAME', direction: 'ASC' }
})