Error in ExtJS 6 tag field

I created a fiddle that demonstrates an error. The problem is that tagfield ignores the minChars property - when you first focus on this field, you can see a request to the server, which should not be. I did the same with combobox and everything works fine. 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 note that minChars both in the combo box and tagfield are documented similarly ( [1] , [2] ):

minChars: Number

The minimum number of characters that a user must enter before autocomplete and typeAhead activate.

So how can I fix this error?

+5
source share
1 answer

You need to set triggerAction: "all" or triggerAction: "query", depending on how your combo box should filter the results.

+1
source

Source: https://habr.com/ru/post/1260330/


All Articles