Skip to content

Instantly share code, notes, and snippets.

@mindscratch
Forked from anonymous/gist:4331908
Created December 18, 2012 20:57
Show Gist options
  • Save mindscratch/4331912 to your computer and use it in GitHub Desktop.
Save mindscratch/4331912 to your computer and use it in GitHub Desktop.
var AutocompleteView = Backbone.View.extend({
initialize: function() {
this.availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
}
render: function() {
this.$el.html('<input id="tags">');
this.$el.find('#tags')..autocomplete({
source: this.availableTags
});
});
var view = new AutocompleteView();
$('body').append(view.render().el);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment