I am working on Jquery Autocomplete and due to internet poor connection, I have to load my whole list(I mean Json object) on page load itself.Now my question is how do I query on that Json object so my autocomplete get a filter as user start typing keyword in a textbox.
$(document).ready(function () {
$("#InsuranceCompanyDisplayName").autocomplete({
minLength: 2,
source: function (request, response) {
var data = $('#InsuranceCompanyjson').text();
response($.map(data, function (item) {
return {
value: item.InsuranceCompanyDisplay,
id: item.InsuranceCompanyId
}
}))
},
});
});
Here (var data = $('#InsuranceCompanyjson').text();) I get my list from Html page and passes to Jquery Autocomplete. I know on request object I will get term to get user input but how do I use that input and query that Json object as we do in the database using LIKE Keyword.