Jacobian
Jacobian

Reputation: 10802

Bug in ExtJS 6 tagfield

I created a fiddle, which demonstrates the bug. The problem is that the tagfield ignores minChars property - when you first focus on the field, you can see a request to the server, which should not happen. I did the same thing with the combobox and everything works good. This is my code:

    Ext.create("Ext.form.field.Tag", {
        renderTo: "test",
        minChars: 999, //ignored, even though is documented
        enableKeyEvents: true,
        displayField: "text",
        valueField: "id",
        queryMode: "remote",
        autocomplete: "off",
        fieldLabel: "tagfield",
        store: {
            autoLoad:false,
            fields:[{name:'id'},{name:'text'}],
            proxy:{
                type:'ajax',
                url:'getData.php'

            }

        }
    });

    Ext.create("Ext.form.field.ComboBox", {
        renderTo: "test2",
        minChars: 999,
        enableKeyEvents: true,
        displayField: "text",
        valueField: "id",
        queryMode: "remote",
        autocomplete: "off",
        fieldLabel: "combo",
        store: {
            autoLoad:false,
            fields:[{name:'id'},{name:'text'}],
            proxy:{
                type:'ajax',
                url:'getData.php'

            }

        }
    });

Please, pay attention to the fact that minChars in both combobox and tagfield is documented similarly ([1], [2]):

minChars : Number

The minimum number of characters the user must type before autocomplete and typeAhead activate.

So, how can I fix this bug?

Upvotes: 5

Views: 643

Answers (1)

Kutty
Kutty

Reputation: 722

You need to set the triggerAction:'all' or triggerAction:'query' config option based on how your combo box should filter the results.

Upvotes: 1

Related Questions