Kendo Ui 下拉列表设置可见通过 Javascript
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23342314/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Kendo Ui Dropdownlist Set Visible via Javascript
提问by MustafaP
I need to set kendo dropdownlist visible programmatically in javaScript.
我需要在 javaScript 中以编程方式设置剑道下拉列表可见。
I had tried:
我试过:
dropdownlist=$("#ddl").data("kendoDropDownList");
dropdownlist.visible(false);
dropdownlist.isVisible(true);
dropdownlist.visible("false");
dropdownlist.isVisible("true");
etc...
等等...
回答by Lars H?ppner
One should always use the API docs to see the features of a widget. In this case, there is no API method for hiding a widget, but you can hide its wrapper element:
应该始终使用 API 文档来查看小部件的功能。在这种情况下,没有用于隐藏小部件的 API 方法,但您可以隐藏其包装元素:
var dropdownlist = $("#ddl").data("kendoDropDownList");
dropdownlist.wrapper.hide(); // call wrapper.show() to make it visible again
回答by Jaimin
Try like this,
试试这样,
$("#ddl").closest(".k-widget").hide();
$("#ddl").closest(".k-widget").show();