I\'m trying to create some search functionality across several types of data, with autocomplete. I\'d prefer to have custom views for each autocomplete suggestion, as well a
This is the accepted answer by @natedavisolds updated for use with Jquery UI 1.10.
$.widget("custom.catcomplete", $.ui.autocomplete, {
_renderMenu: function( ul, items ) {
var that = this;
var currentCategory = "";
$.each( items, function( index, item ) {
if (item.category != currentCategory) {
$('').addClass('ui-autocomplete-category').html(convert_category(item.category)).appendTo(ul);
currentCategory = item.category;
}
that._renderItemData( ul, item );
});
}
});