I have bind datalist in Input type, for auto complete. Its working fine when small anount of data, but web page get not responding on large amount of data. Please suggest me if any other way to bind.
<input type="text" class="form-control" id="drp" list="datalst"/>
<datalist id="datalst"></datalist>
$.ajax({
type: "POST",
url: Urldata,
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify(obj),
success: function (response) {
$("#datalst").html('');
if (response != null) {
if (response.length > 0) {
Resultdata = "";
var lst= $.parseJSON(response);
$.each(lst, function () {
Resultdata += "<option data-id='" + this.ID + "' value='" + this.value + "'>";
});
$("#datalst").append(Resultdata); // **taking time to appned**
}
}
}, error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
console.log(jqXHR.responseText);
} else {
alert('Unexpected error.');
}
}
});