2

使用 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' }
    })
4

1 回答 1

0

这篇博文中详述的解决方案解决了我的问题。似乎我需要一种方法来使匹配不区分大小写。确实,匹配是在 displayField 的原始值上完成的。

http://atechiediary.blogspot.in/2013/06/first-page-extjs-containslike-search-in.html

于 2013-11-06T18:05:33.417 回答