I am using the autocomplete to display items that contain html markup such as T128 The first script will display the autocomplete list, but not as html..it will display T128 in the list, but I can select the item:
var createAutocomplete = function () {
var $input = $(this);
var options = {
source: $input.attr("data-jax-autocomplete"),
minLength: 3
};
$input.autocomplete(options)
};
I found a fix that will render the html markup in the autocomplete list, but after changing the script, I found that I can no longer select an item on the list:
var createAutocomplete = function () {
var $input = $(this);
var options = {
source: $input.attr("data-jax-autocomplete"),
minLength: 3
};
$input.autocomplete(options).data("autocomplete")._renderItem = function (ul, item) {
return $("<li></li")
.append("<a>" + item.label + "</a>")
.appendTo(ul);
};
};