5
votes

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?

1
you should report it into senchas forum - Mr.Bruno
I know, they monitor SO as well. So, I hope they will pay attention to it. - Jacobian
@Evan Trimboli . Thank you, sir! Though, it seems misleading. It seems like if minChars is set to something, then this property should be obeyed, regardless of other properties. - Jacobian
But still, in case of combobox this property behaves like it is related to trigger clicking behaviour - Jacobian

1 Answers

1
votes

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