Please see the following example fiddle :
Although I can select the option from the dropdown, typing doesnt autocomplete. I would expect that when you type B or A you should get the recommendation for banana, apple. Only when of my items in the list is not an existing item it should ask me to add it...
var data = [ "banana", "apple", "orange" ]; var items = data.map(function(x) { return { item: x }; });
$('#input-tags').selectize({
delimiter: ',',
persist: false,
maxItems: 1,
create:true,
options: items,
labelField: "item",
valueField: "item"
});
Any ideas?
Note the same scenario seems to be working with predefined values : Fiddle
You need to add a
searchField: "item"
to the selectize declaration
here's the fixed fiddle: http://jsfiddle.net/wh6Nx/
to add items you need a
create: function(input) {
return {
value: input,
text: input
}
}
fiddle with both: http://jsfiddle.net/2ZrEu/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With