I use your library for my web site and I needed a way to display the whole suggestions because I pre fill the auto completion.
The patch don't alter the rest of the library.
diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js
index 245b3b1..220bea7 100644
--- a/src/jquery.autocomplete.js
+++ b/src/jquery.autocomplete.js
@@ -610,6 +610,33 @@
}
return currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) + value;
+ },
+
+ display: function() {
+ var that = this,
+ className = that.classes.suggestion,
+ suggestionSelector = '.' + that.classes.suggestion,
+ container = $(that.suggestionsContainer),
+ html = '';
+
+ $.each(that.options.lookup, function(i, suggestion) {
+ that.suggestions.push(suggestion.value);
+ html += '<div class="' + className + '" data-index="' + i + '">' + suggestion.value + '</div>';
+ });
+
+ container.html(html).show();
+ that.visible = true;
+
+ // reinstall handler
+ container.on('click', suggestionSelector, function () {
+ that.el.val(that.suggestions[$(this).data('index')]);
+ });
+
+ // Select first value by default:
+ if (that.options.autoSelectFirst) {
+ that.selectedIndex = 0;
+ container.children().first().addClass(classSelected);
+ }
}
};