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) { ... };
}
});
@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