I'm using remote datasource which is a database query. Max results from the query is 1000. I'm using the "term" parameter to filter my results, but the response is slow. It's actually not too bad on 2 characters, but the if you type one letter it's almost 3 seconds to return. I switch from YUI to jquery. I had this working much faster with YUI using the same datasource. The response was instant on 1 character. Is there a better way to do this? Code below.
$(function() {
$("#xContact").autocomplete({
minLength: 1,
source: "<$strLower(HttpWebRoot)$>data/employee_lookup.php",
focus: function( event, ui ) {
$( "#xContact" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#xContact" ).val( ui.item.label );
return false;
}
})
.data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.label + "<br><span style='font-size:0.8em'>" + item.desc + "</span></a>" )
.appendTo( ul );
};
});