Pixabay/jQuery-autoComplete — pull request #3 by amcnea (2014-11-21 03:13:14+00:00)
Title: Added functionality to override default autoComplete item rendering via options

Minified Version Updated
ReadMe Updated

With this change one no longer needs to pass in an array of strings into the suggest() function. This is still the default behavior, but now one may override the 'autocomplete-suggestion' item render to allow one to render any data item passed into the suggest() function.

This is handled by overriding the renderItem() function in the options variable. The renderItem() function takes 2 parameters 'item' and 'search'. Where item is an item in the suggest array and search is the search term used.

Below is a patch that will alter demo.html to use an array of objects instead of an array of strings. Each string can now be found in data[i].name instead of data[i]

```diff
diff --git a/demo.html b/demo.html
index ffa6cfe..6493632 100644
--- a/demo.html
+++ b/demo.html
@@ -239,11 +239,19 @@ $('input[name="q"]').autoComplete({
minChars: 1,
source: function(term, suggest){
term = term.toLowerCase();
- var choices = ['ActionScript', 'AppleScript', 'Asp', 'Assembly', 'BASIC', 'Batch', 'C', 'C++', 'CSS', 'Clojur
+ var choicesArr = ['ActionScript', 'AppleScript', 'Asp', 'Assembly', 'BASIC', 'Batch', 'C', 'C++', 'CSS', 'Clo
+ choices = [];
+
+ for (i=0;i' + item.name.replace(re, "$1