Kendo Ui Dropdownlist Set Visible via Javascript

2020-08-17 05:06发布

I need to set kendo dropdownlist visible programmatically in javaScript.

I had tried:

dropdownlist=$("#ddl").data("kendoDropDownList");
dropdownlist.visible(false);
dropdownlist.isVisible(true);
dropdownlist.visible("false");
dropdownlist.isVisible("true");

etc...

2条回答
来,给爷笑一个
2楼-- · 2020-08-17 05:53

Try like this,

$("#ddl").closest(".k-widget").hide();
 $("#ddl").closest(".k-widget").show();
查看更多
爷的心禁止访问
3楼-- · 2020-08-17 06:07

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:

var dropdownlist = $("#ddl").data("kendoDropDownList");
dropdownlist.wrapper.hide(); // call wrapper.show() to make it visible again
查看更多
登录 后发表回答