I've just put up a couple of extensions for the jquery 1.8 autocomplete plugin here:
jquery.ui.autocomplete.cache.js
:
When using a remote data source, this plugin will store responses so that subsequent searches for the same term will not need to go to the server. To use, include it after the autocomplete plugin and set the 'cache' option to true as you would any other option for the autocomplete plugin.
jquery.ui.autocomplete.customItem.js
:
Allows you to specify a custom function for generating the visible text for each item in the suggestion list.
To use, set the 'customItem' option as you would any other option for the autocomplete plugin. The value of the option should be a function with the following signature:
- function(term, item)
The function should return a jQuery selection representing an anchor tag with the desired text for the suggestion item. The
term
parameter will contain the search term associated with the result set and the
item
parameter will contain a reference to the selected item.
Example:
- function(term, item) {
- return $("<a></a>").text(term + ': ' + item.label);
- }
Enjoy!