jquery - Managing too much data coming back from server in ajax request -
jquery - Managing too much data coming back from server in ajax request -
i have issue. need populate 1 dropdown list of items. way doing select top 500, need items in there , there 1000 or more. below paste of amount of info im trying send when site crashs.
http://pastebin.com/d5xjdvur
jquery:
$.ajax({ type: "post", url: "webservice.asmx/getfinish1", data: '{' + 'item:"' + item + '"' + '}', contenttype: "application/json; charset=utf-8", datatype: "json", success: function (msg) { //$("#item").val(msg); var info = jquery.parsejson(msg); if (!data.error) { $.each(data, function (d) { var areatext = $('#notes').val(); if (data[d].dropdown == "finish1") { if (data[d].value != "") { $("<option>").attr("value", data[d].id).text(data[d].value).appendto($('#dropfinish1')); } } if (data[d].dropdown == "finish2") { if (data[d].value != "") { $("<option>").attr("value", data[d].id).text(data[d].value).appendto($('#dropfinish2')); } } if (data[d].dropdown == "length") { if (data[d].value != "") { $("<option>").attr("value", data[d].id).text(data[d].value).appendto($('#droplength')); } } if (data[d].dropdown == "unit") { if (data[d].value != "") { $("<option>").attr("value", data[d].id).text(data[d].value).appendto($('#dropunit')); } } if (data[d].dropdown == "notes") { if (data[d].value != "") { $('#notes')[0].value = areatext + data[d].value; } } });
i argue no 1 wants dig through 1000+ items in drop downwards unless it's kind of auto completing drop downwards can type hints into. sounds there much data. focus on trying split dataset pieces getting user come in information. if can couple of piece of info utilize create query results 10th of size you're in shape. that's how i've solved problem before.
jquery
Comments
Post a Comment