简体   繁体   English

dojo filterSelect-仅允许输入列表项

[英]dojo filteringSelect - allow entry of list items only

Is there a way to force filteringselect to only allow the user to type items that appear in the drop list. 有没有一种方法可以强制filterselect只允许用户键入出现在下拉列表中的项目。 I know that it will invalidate anything that is not in the list, but I would just rather it not allow invalid entries to show. 我知道它将使列表中未包含的任何内容无效,但我宁愿它不允许显示无效条目。 Really, what I would like to see is behaviour that matches the HTML SELECT control. 确实,我希望看到的是与HTML SELECT控件匹配的行为。 Dojo doesnt seem to provide this with any of its controls. Dojo似乎没有为此提供任何控件。

Im not sure if I read you okay but this is how it things go: 我不确定我是否读懂你的意思,但这是这样的:

  • If you type what is in the drop list of the FilteringSelect widget then there will be no validation error. 如果键入FilteringSelect小部件的下拉列表中的内容,则不会出现验证错误。

  • If you want to match the HTML Select dropdown, then use dijit.form.Select . 如果要匹配“ HTML选择”下拉列表,请使用dijit.form.Select

  • If you want to Filtering Select behaviour but want also be able to type in values that are not in the drop list, then use the dijit.form.ComboBox widget. 如果要进行“筛选选择”行为,但又希望输入下拉列表中未包含的值,请使用dijit.form.ComboBox小部件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM