TextboxList 0.4: On-Demand suggestions
TextboxList 0.4 is out, with new features:
checkoption, which can allow you to specify a function to filter out new boxes that do not meet a requirementencodenow receives the complete values, not only the id or string of the bit. This gives you full control of what you want to send to the server.-
Autocomplete now works with on-demand suggestions. As easy as this:
new TextboxList('form_tags_input_4', {unique: true, plugins: {autocomplete: { minLength: 3, queryRemote: true, remote: {url: 'autocomplete2.php'} }}});
And some bugfixes:
- Fixed missing index when unique: false and autocomplete were used, which resulted in an error
- Fixed problems with items with id 0, which incorrectly evaluated as false.
Head to the demo to see the new autocomplete in action, and as usual, report any bugs you might encounter.
Update: 0.5 is out already, which fixes a bug with the traditional use of Autocomplete. Sorry for the trouble!
Displaying only a subset of the comments. Click here to display all comments.
Why do you use another index array in the autocompleter plugin (this.index) instead of rely on this.textboxlist.index at all?
To make it work for my needs I had to modify line 102 (showResults) to:
if (this.textboxlist.index) { results = results.filter(function(v){ return !this.textboxlist.index.contains(this.textboxlist.uniqueValue(v)); }, this); }
(also I totally removed the this.index property from the autocompleter, because it’s value was used only in the showResults function)
Using this I can put existing values (bits) to the control when the page loads, and then the autocompleter will not show them again in the dropdown. Tell me please if you know a better way to solve my problem.
Hope you got it, sorry for my poor english.
Anyway, thanks for this great component, it’s very useful!