make combobox empty after return from controller

2 posts, 0 answers
  1. Rahul
    Rahul avatar
    3 posts
    Member since:
    Feb 2013

    Posted 02 Jul 2014 Link to this post

    I have a kendo combobox
    @(Html.Kendo().ComboBox()
     .Name("ddSystems")
    .Filter("contains")
    .Placeholder("-- Select --")
    .BindTo((IEnumerable)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.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 07 Jul 2014 Link to this post

    Hi,

    Setting the value to null should reset the combobox. Here is a live demo: http://trykendoui.telerik.com/@korchev/ORuS

    Regards,
    Atanas Korchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top