I have an autocomplete on a page, and I would like the autocomplete to re-query the data source every time it is used. For example, if someone loads up the page and they use the autocomplete control, everything is good. But, if the underlying data in the database changes after the page is loaded, and after this initial query, any new rows are not reflected in the autocomplete control. The control appears to hold on to the data that it got from the first query and not go back to the data source.
If I refresh the page then it is ok, the new rows appear, but my users expect the autocomplete to always reflect that is in the database even if the data changes after the page is loaded and after the autocomplete control has queried the database already.
Does anyone know how this can be achieved? I have tried various combinations of ServerFiltering and specifying the Action Type as "Post" (as suggested by various internet articles), without getting the desired results.
I believe my code is fairly normal, nothing unusual going on here I think (apart from the dodgy formatting):
@(Html.Kendo().AutoComplete()
.Name("newWorkOrderAutoComplete")
.DataTextField("WorksOrderNumber")
.MinLength(2)
.HtmlAttributes(new { style = "width: 250px" })
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetWorkOrderHeaders", "Kitting").Type(HttpVerbs.Post);
})
.ServerFiltering(false);
})
.IgnoreCase(true)
.Suggest(true)
.Animation(a =>
{
a.Open(open =>
{
open.Duration(300);
open.Zoom(ZoomDirection.In);
});
a.Close(close =>
{
close.Duration(300);
close.Zoom(ZoomDirection.Out);
});
})
)
Thanks in advance,
Peter