I think this should be a matter of calling search
from the select
handler. As you may have discovered, however, this doesn't work quite right.
You should be able to make it work by adding a small timeout:
select: function(event, ui){
if(ui.item.value == "More Options"){
pageCountClientId++;
setTimeout($.proxy(function () {
$(this).autocomplete('search', this.value);
}, this), 1);
}
else if(ui.item.value == "Previous Options"){
pageCountClientId--;
setTimeout($.proxy(function () {
$(this).autocomplete('search', this.value);
}, this), 1);
}
else{
$("#clientName").val(ui.item.value);
$("#clientId").val(ui.item.label);
$("#clientName").attr("disabled", "disabled");
$("#clientId").attr("disabled", "disabled");
}
return false;
},
Example: http://jsfiddle.net/fTFkY/2/
The example uses a local source but simulates an AJAX request. Hopefully this helps!