Skip to content

Instantly share code, notes, and snippets.

@DBasic
Created March 14, 2014 11:00
Show Gist options
  • Save DBasic/9545690 to your computer and use it in GitHub Desktop.
Save DBasic/9545690 to your computer and use it in GitHub Desktop.
jQuery UI Autocomplete _renderItem usage.
$("#some_id")
.autocomplete({
...
}).data("ui-autocomplete")._renderItem = function (ul, item) { ... };
If you want to create the _renderItem function for multiple autocompletes with id #some_id just use it in the create event:
$('#some_id').autocomplete({
create: function() {
$(this).data('ui-autocomplete')._renderItem = function (ul, item) { ... };
}
});
@gmansilla
Copy link

thanks.

@mrmnmly
Copy link

mrmnmly commented Mar 3, 2015

If I'm trying to get some data from remote resource then how I can put its (object) attributes inside _renderItem function?

@wonderer007
Copy link

Thanks it works for me

@yusetc
Copy link

yusetc commented Mar 13, 2017

Thanks a lot, a definitive solution for remote data source and multiple autocompletes!!

@misarji
Copy link

misarji commented Feb 5, 2018

It works for multiple instances on same page, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment