-
Notifications
You must be signed in to change notification settings - Fork 996
Allow the user to add new items by simply writing them and hitting enter/comma #105
base: master
Are you sure you want to change the base?
Conversation
…Exp special chars. So you better escape'em. Cheers
… need for an item To DRY stuffs up, we now base the item based add_token() on _add_token()
If newItemFilter is a function we call it with a callback named "addItem" and the value of the item the user wants to add. After manipulating the item, calling addItem(item) will add it. You can choose not to add an item by simply not calling addItem.
Is this the same as #87 ? |
+1 to get this merged |
Hey @brodock. I recommend you to take a look at my fork of jquery-tokeninput at https://github.com/vdepizzol/jquery-tokeninput. It implements this and a couple of other things as well. |
need it |
+1 |
1 similar comment
+1 |
Hey guys, I've merged in some changes recently which make this pull request difficult to merge. Anyone interested in refactoring this pull request to work with 1.6.0 and the new |
I really need this feature, so i'll do this refactoring. |
I've already updated it about two weeks ago, maybe it's of some help? |
navale, i tried your fork (master and token-on-the-fly branch) but couldn't get this feature working out of the box. |
@Capsized: Like on this pull request's diff page; allowNewItems is false by default, so you need to set it to true in your config :) Op 14 aug. 2011 om 00:57 heeft capsizedreply@reply.github.com het volgende geschreven:
|
@navale, thanks for pointing that out. :) still learning to find my way around github. |
Can someone please review and test my changes? Changes to Changes to The demo page won't work without changing the script path for |
@janpieper I tried using your changes for the allowNewTokens and the token-field changes back to a regular text-field when i add that new option. If I use the regular options it works correctly. This doesn't work: $(function() { This DOES work: $(function() { Even when I removed all other options besides allowNewTokens, it still didn't work. |
It's not possible to use |
Well....it does "work" when added tokenValue: "name" but in my Ruby-on-Rails application it should also have an ID assigned to it along with a name when I create it. Without RoR I can say it does work. Thanks, good job. |
+1 merge plz |
+1 merge |
1 similar comment
+1 merge |
I opened an issue, maybe could be related to this new feature, see #179 |
This thread helped me out, thanks. |
+1 merge |
merge it please |
Allow the user to add new items :) |
select_dropdown_item(this_li); | ||
// Select the first item, unless we allow the user to add new | ||
// items. | ||
if (settings.allowNewItems === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you check for this here and then not allow selection? Doing so breaks the ability to use the arrows to search through results.
merge, merge, merge |
@janpieper Do you still have your refactoring? The links are broken... |
@johans yeah i still have a local copy (see https://gist.github.com/4512379), but it hasn't been updated since I made my changes, so if you need some 1.6.1 features, you need to merge them by yourself. Will try to setup a new fork over the weekend. This code example isn't tested and is poorly extracted from my application that is using this jQuery-plugin. $("#my-fancy-token-input").tokenInput("/autocomplete", {
allowNewTokens: true,
propertyToSearch: "label",
tokenValue: "label",
preventDuplicates: true
}); If you have any problems getting it working, please contact me and i'll help you. |
Why does it not merged? |
fd2316b
to
8a8390e
Compare
No description provided.