Skip to content

Instantly share code, notes, and snippets.

@MarkBorcherding
Forked from doxavore/gist:736619
Created December 10, 2010 19:03
Show Gist options
  • Save MarkBorcherding/736624 to your computer and use it in GitHub Desktop.
Save MarkBorcherding/736624 to your computer and use it in GitHub Desktop.
// jQuery barfs because $(empty).data("autocomplete") => undefined
$(".course-autocomplete").autocomplete({
source: "/courses/autocomplete.json"
}).each(function(i,v){
v.data("autocomplete")._renderItem = function(ul, item) {
return $("<li>")
.data("item.autocomplete", item)
.append("<a>" + item.name + "</a>")
.appendTo(ul);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment