0

I am using selectpicker with 1.12.1 version. when i try to load more then 1000 records it will take time to load once click. Below code i am using to bind dropdown.

$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "AjaxGetDropdown.aspx?Type=getengine&MajorID=" + MajorID + "&MacModID=" + MacModId,
success: function (data) {
    if (data != null && data != '') {
        $.each(data, function () {
            if (document.getElementById('<%=hfEngModID.ClientID%>').value == this['VALUE']) {
                $("#dpEngine").append($("<option selected='selected'></option>").val(this['VALUE']).html(this['TEXT']));
            } else {
                $("#dpEngine").append($("<option></option>").val(this['VALUE']).html(this['TEXT']));
            }

        });
        $("#dpEngine").selectpicker('refresh');
    }
},
error: function (data) {
}
});
Purvesh Desai
  • 1,797
  • 2
  • 15
  • 39
  • this is probably logical, since it would create a lot of data and html elements, you browser needs time to render it. It could also mean the ajax call is slow because it needs to send over so much data. You can check in your developers tools inside the website (under tab: network/profiles) what takes so long. – Joel Harkes Jan 17 '17 at 13:26
  • even after my ajax call, once i fill all the records then after each time when i click on dropdown to open up and show records it will take about 2seconds. – Purvesh Desai Jan 18 '17 at 03:35

0 Answers0