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

AutoComplete occasionally just... doesn't work

1 Answer 112 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 16 Nov 2012, 04:40 PM
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)
      .MinLength(3)
      .HtmlAttributes(new { @class="autocomplete" })
      .Events(e => e.Change("removeTitle"))
      .DataSource(ds => ds.Read(r => r.Action("GetUserNames", "Ajax"))
                          .ServerFiltering(true)))

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)
      .MinLength(3)
      .HtmlAttributes(new { @data_url = Url.Action("PopulateSite"), @class="autocomplete" })
      .Events(e => e.Select("selectSite"))
      .DataSource(ds => ds.Read(r => r.Action("GetSites", "Ajax"))
                          .ServerFiltering(true)))
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.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 19 Nov 2012, 09:24 AM
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.

Greetings,
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!
Tags
AutoComplete
Asked by
Dave
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or