AutoComplete occasionally just... doesn't work

2 posts, 0 answers
  1. Dave
    Dave avatar
    35 posts
    Member since:
    Oct 2012

    Posted 16 Nov 2012 Link to this post

    I have 3 Kendo MVC AutoCompletes on a page, and they occasionally just decide not to work. I can't figure it out.

    First of all, if I add a Change event, like so:

    @(Html.Kendo().AutoCompleteFor(m => m.NewIssue.Responsible)
          .HtmlAttributes(new { @class="autocomplete" })
          .Events(e => e.Change("removeTitle"))
          .DataSource(ds => ds.Read(r => r.Action("GetUserNames", "Ajax"))

    It no longer calls my Ajax function to return user names. And of course, it doesn't drop down with values.

    If I take out the Change event, sometimes it works and sometimes it doesn't. Sometimes it calls my Ajax function, gets a JSON list of users, but then doesn't dropdown with any values.

    Here's another issue.
    @(Html.Kendo().AutoCompleteFor(m => m.NewIssue.SiteNumber)
          .HtmlAttributes(new { @data_url = Url.Action("PopulateSite"), @class="autocomplete" })
          .Events(e => e.Select("selectSite"))
          .DataSource(ds => ds.Read(r => r.Action("GetSites", "Ajax"))
    This one calls it's Select event correctly when I select an item, but it also calls it's select event when I post the form using a regular Input Submit button. This one just blows my mind. I don't know how to fix this.

    My project has 3 or 4 Kendo controls in it, and out of all of them, AutoComplete seems to be the most half-baked. It just doesn't seem reliable. I'm not doing anything crazy with them. I have 3 AutoCompletes in a form, one of them has a Select event, and I'm trying to add change events to the rest. I wonder if I should be using javascript to create these instead of the MVC wrapper, maybe that's causing issues? I really don't know.

    Anyway, I'm not sure anyone can help me with the limited information I've provided, but I wanted to put it out here anyway. Thanks.
  2. Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 19 Nov 2012 Link to this post

    Hello Dave,

    We are not aware of such problems regarding change/select events of the AutoComplete widget. I will ask you to modify the test project that I send you in the support ticket opened on the same matter. Also I will suggest you continue our discussion the support thread in order to avoid any duplications.

    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!
Back to Top