Skip to content

Instantly share code, notes, and snippets.

@ericlbarnes
Created June 24, 2013 12:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ericlbarnes/5849580 to your computer and use it in GitHub Desktop.
Save ericlbarnes/5849580 to your computer and use it in GitHub Desktop.
this.selectize = this.$("#js-tags").selectize({
persist: true,
maxItems: null,
valueField: "tag",
labelField: "tag",
searchField: ["tag"],
options: tags.toJSON(), // Backbone collection
render: {
item: function(item) {
return "<div><i class='icon-tag'></i> " + item.tag + "</div>";
},
option: function(item) {
return "<div><i class='icon-tag'></i> " + item.tag + "</div>";
}
},
create: function(input) {
return {
"tag": input
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment