At my page i have about 20 common html select widgets. For example:
I have provided a set of working example of combo-box using jQuery UI selectmenu. I have used basic JSON source for ajax request, please work on this part yourself.
$(".ajax-combo").selectmenu({
"width": "100px",
});
$(".ajax-combo").selectmenu("menuWidget").addClass("make-scrolling");
$(".ajax-combo").selectmenu("menuWidget").scroll(function(e) {
if (e.currentTarget.scrollHeight - 10 < e.currentTarget.scrollTop + $(e.currentTarget).height()) {
var curTar = e.currentTarget;
var lastTop = curTar.scrollTop;
$.getJSON("http://echo.jsontest.com/10/test/20/rest/30/best/40/vest/50/fest", function(data) {
$.each(data, function(key, val) {
$(".ajax-combo").append("");
});
$(".ajax-combo").selectmenu("refresh");
curTar.scrollTop = lastTop;
});
}
});
.make-scrolling {
overflow-y: scroll;
height: 150px;
}