Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a kendo combobox

   @(Html.Kendo().ComboBox()
        .Name("ddSystems")
        .Filter("contains")
        .Placeholder("-- Select --")
        .BindTo((IEnumerable<SelectListItem>)ViewBag.systemList)
        )

Onchange, a textbox is loaded in ajax. A submit button posts the textbox value and combobox value to the controller. When I get back to the view, I need ddSystems to be reset to empty. I used

  $('#ddSystems').data('kendoComboBox').value(null)

and

 $('#ddSystems').data('kendoComboBox').text('')

but it always retains the previously selected value. Since I use ajax, this will not display the textbox and I am stuck. Please help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
153 views
Welcome To Ask or Share your Answers For Others

1 Answer

This will clear the combo box and disable it

Google is your best friend....

 var combobox = $("#comboBox").data("kendoComboBox");
 combobox.value();
 combobox.enable(false);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...