asp.net - Populate a DropDownList with AJAX -
i have long list of items dropdownlist. list long, show items in list if user clicks on dropdownlist expand it. found various tutorials on how use ajax cascading dropdownlists none explaining if possible have 1 dropdownlist gets populated ajax when user expands it.
are there extenders coming ajax toolkit missed? best way of achieving this?
thanks, ben
what this:
have 1 empty item in list. when dropdownlist receives focus change 1 item loading or that. make ajax call want.
once completes unbind focus event dropdown don't reload on subsequent focus events.
seems wouldn't difficult this.
i'll see if can whip on jsfiddle if need help.
edit: way question extenders don't know that.
edit 2: try this:
$(document).ready( function() { $("#theselect").bind("focus", function() { $("option:first", this).html("loading..."); settimeout(ajaxsuccesscall, 2000); }); }); function ajaxsuccesscall(data) { var select = $("#theselect"); select.unbind("focus"); select.children("option").remove(); }
Comments
Post a Comment