Add a css class like this.
.loading
{
background:url('path to your image') no-repeat right center;
}
Now enable the search option and open the autocomplete options
$("#txtPONO").autocomplete({
source: "/Transection/GetPONO",
minLength: 2,
select: function (event, ui) {
$("#hdnPurContID").val(ui.item.id);
},
search: function(){$(this).addClass('loading');},
open: function(){$(this).removeClass('loading');}
});
OR
An even better solution would be to simply use the css class
.ui-autocomplete-loading { background:url('img/loading.gif') no-repeat right center }
jQuery ui-autocomplete-loadingautomatically launches the loaded image at boot time
Hope this helps
source
share