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:
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.
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.
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)))
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.