我创造了一个小提琴,它演示了这个bug.问题是tagfield会忽略minChars属性 - 当您第一次关注该字段时,您可以看到对服务器的请求,这不应该发生.我用组合框做了同样的事情,一切都很好.这是我的代码:
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'
}
}
});
Run Code Online (Sandbox Code Playgroud)
请注意,minChars在组合框和标记字段中都有相似的记录([1],[2]):
minChars:数量
用户在自动完成和typeAhead激活之前必须输入的最小字符数.
那么,我该如何修复这个bug?
| 归档时间: |
|
| 查看次数: |
389 次 |
| 最近记录: |