Kendo UI Combo Box Reset Value

Kendo UI Combo Box Reset Value


$("#ComboDdlCustomers").data("kendoComboBox").value(null);

Example in Detail as given below.

Kendo UI Combo Box MVC code

@(Html.Kendo().ComboBox()
    .Name("ComboDdlCustomers")
    .Filter("contains")
    .Placeholder("Select Customer...")
    .HtmlAttributes(new { style = "width:320px" })
    .DataTextField("Text")
    .DataValueField("Value")
    .BindTo(custLst1)
    .SelectedIndex(3)
    .Suggest(true)
    .Events(e =>
    {
        e.Select("onSelect");
    })
)


JavaScript code for onSelect() function event and Reset Value of Kendo UI Combo Box.

function onSelect(e) {
    var dataItem = this.dataItem(e.item.index());
    var custAccount = new Object();
    custAccount.erpCustomerId = dataItem.Value;

    // Reset Value of Kendo UI Combo Box.
      $("#ComboDdlCustomers").data("kendoComboBox").value(null);
}



ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
http://www.code-sample.com
http://www.code-sample.xyz

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.