My select event doesn\'t work if I use _renderItem. If I comment out the last block of code where I call _renderItem, the select event works. When I use _renderItem, the se
I believe this is because you are not wrapping the item in an anchor (a
) tag. Update your code to wrap the img
in an anchor and it'll work fine:
$.ui.autocomplete.prototype._renderItem = function(ul, item) {
return $("")
.data("item.autocomplete", item)
.append('' + item.label + '')
.appendTo( ul );
};
Here are some examples that might help:
Example without including an a
tag in the markup generated in _renderItem
(select
is broken here like in your question): http://jsfiddle.net/MaLqe/
Example with an a
tag in the generated markup: http://jsfiddle.net/3zSMG/