Skip to content

Instantly share code, notes, and snippets.

@RimonEkjon
Forked from ericlbarnes/selectize.js
Created August 26, 2014 05:27
Show Gist options
  • Save RimonEkjon/779e63104e1caf0417a4 to your computer and use it in GitHub Desktop.
Save RimonEkjon/779e63104e1caf0417a4 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