Created
July 11, 2014 09:06
-
-
Save rhyzx/2281e8d1662b7be21716 to your computer and use it in GitHub Desktop.
disable Selectize sifter search engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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