Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to hide kendo dropdownlist from form

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.

like image 927
Minh Toan Avatar asked Oct 21 '25 02:10

Minh Toan


2 Answers

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
like image 110
Coder Avatar answered Oct 26 '25 19:10

Coder


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.

like image 36
Siderite Zackwehdex Avatar answered Oct 26 '25 20:10

Siderite Zackwehdex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!