This is a migrated thread and some comments may be shown as answers.

Reset a DropDownList

2 Answers 2104 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Cyndie
Top achievements
Rank 1
Cyndie asked on 11 Jan 2012, 04:27 PM
I have a series of cascading dropdownlists.  When the first one is changed, the second is updated based on the selection from the first list.  I would like for the 3rd and 4th to be reset to a blank list until the user selects a value from the second list (which will fire its change event and repopulate it).  I've tried to add the following in the change event for the 1st dropdown as I've seen on another forum post, but nothing is hidden when the event fires.  Is there a way to just clear out all of the entries in the list?  I didn't see a method in the doucmentation that appeared to do that.
$("#devType").closest("k-widget").hide();

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 16 Jan 2012, 10:32 AM
Hello Cyndie,

 
You can clear the DropDownList widget using this code snippet:

$("#dropdownlist").val("").data("kendoDropDownList").text("")

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Cyndie
Top achievements
Rank 1
answered on 16 Jan 2012, 09:42 PM
Thank You!
Tags
DropDownList
Asked by
Cyndie
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Cyndie
Top achievements
Rank 1
Share this question
or