I have many kendo dropdownlist in a form but I just want to hide only kendodropdownlist. Here is my code to hide:
$("#minpass").css("display", "none");
$("#minpass").hide();
I search in the internet and I found this solution , it can hide but all dropdownlist in a form disappear. this is code:
var minpassdropdownlist = $("#minpass").data("kendoDropDownList");
minpassdropdownlist.closest(".k-widget").hide();
Here is my kendodropdownlist:
$("#minpass").kendoDropDownList({
dataTextField: "text",
dataValueField: "value"
});
Please help me, thanks.
Try this I think this will work
var dropdownlist = $("#dropDownList").data("kendoDropDownList");
dropdownlist.wrapper.hide(); // call for hide kendo dropdown call
dropdownlist.wrapper.show();// to make it visible again
I have not seen any method of the kendo UI dropdownlist that can hide it. I found destroy which may be able to remove any changes done around the original select element and then you can hide it, having to redo the Kendo dropdownlist when you show it again.
The .closest solution should work, judging by the control's demo page. The original input element is hidden inside a series of spans, the top one having the class k-widget k-dropdown k-header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With