禁用“找不到匹配项";在select2上输入文字和自动完成 [英] Disable "No matches found" text and autocomplete on select2
本文介绍了禁用“找不到匹配项";在select2上输入文字和自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在select2/Tagging支持的自动完成功能上禁用找不到匹配项"文本?
How do you disable the "No matches found" text on autocomplete on select2/Tagging Support?
这就是我现在拥有的:
$('#ProductDescriptions_30_keywords').select2({
tags:[],
tokenSeparators: [",", " "],
minimumResultsForSearch: -1
}
);
但是它仍然在自动完成窗口中显示找不到匹配项"消息.我想删除它.
But it still shows the "No matches found" message in autocomplete window. I would like to remove this.
推荐答案
我想我明白了您的意思...如果用户将值输入到列表中不存在的搜索字段?
I think I see what you're getting at... You want to hide the text that says "No matches found" if a user enters a value into that search field that doesn't exist in the list?
您可能可以在CSS中做到这一点:
You can probably do that in CSS:
.select2-no-results {
display: none !important;
}
这是 示例 .
Here's an example.
这篇关于禁用“找不到匹配项";在select2上输入文字和自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文