I think I have read every stackoverflow and google result available on this issue and they all seem to refer to the first jquery autocomplete plugin and not the current jquery ui autocomplete.
What is the method for forcing the autocomplete results to update from the data source instead of the cached list?
You can clear the text inside the SfAutoComplete control by assigning the String. Empty or using the Clear() method in SfAutoComplete.
Autocomplete mechanism is frequently used in modern websites to provide the users a list of suggestion while typing the beginning word in the text box. It facilitates the user to select an item from the list, which will be displayed in the input field.
Syntax: $("TagId"). autocomplete({ source : itemList // List of Words. })
The jquery ui autocomplete does not do any caching. The caching is happening at the browser level. To prevent it from happening, use $.ajaxSetup
.
$.ajaxSetup({ cache: false });
You could also instead supply a function to the source option that does the ajax request for you with cache: false
if you don't want to disable caching globally.
source: function(request, response) {
$.ajax({
url: "url.php",
dataType: "json",
cache: false,
type: "get",
data: { term: request.term }
}).done(function(data) {
response(data);
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With