Skip to content

Instantly share code, notes, and snippets.

@regdog
Forked from ericlbarnes/selectize.js
Created November 19, 2013 08:45
Show Gist options
  • Save regdog/7542253 to your computer and use it in GitHub Desktop.
Save regdog/7542253 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