Created
March 14, 2014 11:00
-
-
Save DBasic/9545690 to your computer and use it in GitHub Desktop.
jQuery UI Autocomplete _renderItem usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#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) { ... }; | |
} | |
}); |
If I'm trying to get some data from remote resource then how I can put its (object) attributes inside _renderItem
function?
Thanks it works for me
Thanks a lot, a definitive solution for remote data source and multiple autocompletes!!
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
thanks.