我正在使用 Kendo UI ComboBox“version:2016:1.112.545”并使用“ http://demos.telerik.com/kendo-ui/combobox/serverfiltering ”作为引用。我将组合框的最小长度设置为三个字符(搜索字符串)。因此,当我输入三个字符时,应该完成对 Web 服务器的请求,并且它按预期工作。现在的问题是,当我清除 ComboBox 中的全部内容时,再次完成对 Web 服务器的请求(使用空搜索字符串)。如何避免这个调用?
(注意:这个问题可以在上面的 telerik demos URL 中重现。使用浏览器的开发者工具来监控服务器调用。)
最佳答案
嘿尝试使用下面给定的代码:-
filtering: function(e) {
var filter = e.filter;
if (!filter.value) {
//prevent filtering if the filter does not value
e.preventDefault();
}
}
请参阅 jsfildde 中的内容:- http://jsfiddle.net/MG89G/1936/
关于kendo-ui - 剑道用户界面 : How to avoid server call when text entered in combobox is less than min length,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35952286/