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.
-
-
i also found this issue and fixed it the same way. no problems so far.
-
I think I just found another issue that may have hit other users (sorry if it’s been reported before). Using the jquery version, I get an error if I click into the input field and then click in it again right away (without typing anything). I traced the error to line 43 of TextboxList.js where the variable ‘current’ is null but the function call toElement() is being called on it.
I’m not 100% sure whether I’ve changed the intent of this line, but it seems to work without error if I simply test whether current is null beforehand. Line 43 now turns to:
if ((e.target == list.get(0) || e.target == container.get(0)) && (!focused || (current && current.toElement().get(0) != list.find(‘:last-child’).get(0)))) focusLast();
Hope that helps some others…