禁用Kendo自动完成功能 [英] Disable Kendo Autocomplete
本文介绍了禁用Kendo自动完成功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此Kendo自动填充代码:
I have this Kendo Autocomplete code:
HTML:
<input id="faceUsers" type="text" placeholder="Search..." data-role="autocomplete" autocomplete="off" role="textbox" aria-haspopup="true" aria-disabled="false" aria-readonly="false" aria-autocomplete="list" aria-busy="false">
JS:
$("#faceUsers").kendoAutoComplete({
dataTextField: "name",
dataValueField: "name",
template: '<img src=\"${data.picture.data.url}\" class="imguser" />' +
'<h4 class="autotext">${ data.name }</h4>',
filter: "contains",
minLength: 1,
height: 370,
dataSource: faceDataSource
});
我已经正确设置了我的 faceDataSource
并且它按预期工作。
I have set properly my faceDataSource
and it works as expected.
我面临的问题是如何禁用此自动完成功能。在特定操作之后,我希望输入
元素在没有自动完成的情况下表现为普通的输入
元素。
The problem i am facing is how i can disable this autocomplete. After a particular action i want the input
element to behave as a normal input
element without autocomplete.
推荐答案
如果要完全删除它,请使用 destroy :
If you want to completely remove it, use destroy:
$("#autocomplete").kendoAutoComplete();
var autocomplete = $("#autocomplete").data("kendoAutoComplete");
autocomplete.destroy();
这篇关于禁用Kendo自动完成功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文