diff --git a/doc/jquery.autocomplete.txt b/doc/jquery.autocomplete.txt index bdddd78..7b11bad 100644 --- a/doc/jquery.autocomplete.txt +++ b/doc/jquery.autocomplete.txt @@ -130,6 +130,13 @@ showResult (default value: null) this function will be called. The returned value will be displayed inside an LI element in the results list. Autocompleter will provide the value and the data. +decorateResults (default value: null) + A JavaScript function that can provide advanced markup for resulting list. This function will + be called for jquery "ul" element. The returned value will be displayed inside top-level div. + Autocompleter will provide jquery-wrapped "ul" element and expects function to return any item + that will contain that "ul" element. Function should not change "ul" element as there are event + handlers bound to it and some function relying on "ul" markup. + onItemSelect (default value: null) A JavaScript function that will be called when an item is selected. The autocompleter will specify a single argument, being the LI element selected. This LI element will have an diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 02fcdc2..7f85f40 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -65,6 +65,7 @@ selectFirst: false, selectOnly: false, showResult: null, + decorateResults: null, preventDefaultReturn: true, preventDefaultTab: false, autoFill: false, @@ -778,10 +779,9 @@ /** * Get all items from the results list - * @param result */ $.Autocompleter.prototype.getItems = function() { - return $('>ul>li', this.dom.$results); + return $('>li', this.dom.$list); }; /** @@ -792,7 +792,7 @@ $.Autocompleter.prototype.showResults = function(results, filter) { var numResults = results.length; var self = this; - var $ul = $('