Skip to content

Instantly share code, notes, and snippets.

@rhyzx
Created July 11, 2014 09:06
Show Gist options
  • Save rhyzx/2281e8d1662b7be21716 to your computer and use it in GitHub Desktop.
Save rhyzx/2281e8d1662b7be21716 to your computer and use it in GitHub Desktop.
disable Selectize sifter search engine
Selectize.prototype.search = function (query) {
return {
query: query,
tokens: [], // disable highlight
items: $.map(this.options, function (item, key) {
return {id: key}
})
}
}
var i = 0
$('input').selectize({
valueField: 'name',
labelField: 'name',
preload: true,
create: true,
load: function(query, callback) {
this.options = {} // clearcache
setTimeout(function () {
// mock data
callback([
{'name': i++},
{'name': i++}
])
}, 300)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment