Reputation: 6633
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...
Upvotes: 13
Views: 21205
Reputation: 945
Calling to DOM by using style property work for me.
document.getElementsByClassName('dropdown1')[0].style.visibility = 'hidden';
document.getElementsByClassName('dropdown2')[0].style.visibility = 'visible';
Upvotes: 0
Reputation: 18402
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
Upvotes: 32
Reputation: 8020
Try like this,
$("#ddl").closest(".k-widget").hide();
$("#ddl").closest(".k-widget").show();
Upvotes: 5