Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to add their own options #326

Closed
wants to merge 7 commits into from
Closed

Allow users to add their own options #326

wants to merge 7 commits into from

Conversation

jimlindstrom
Copy link

This adds a 'data-allows-new-values' tag. When present, that tag causes the widget to change how it deals with the "no results" condition. It adds an "add" button and responds to the button or [enter] adding the term you searched for.

Demo: http://jimlindstrom.com/extendable_select/example.html


Chosen is a library for making long, unwieldy select boxes more user friendly.
Chosen is a great library for turning vanilla 'select' tags into autocompleter-like boxes that are searchable and browsable. This fork adds a new twist by allowing these UI elements to accept new values from the user.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the readme should not be changed in the pull request

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done.

@stof
Copy link
Collaborator

stof commented Nov 4, 2011

And you should modify the sprite to add the new images in it instead of adding separate images

@CHgsd
Copy link

CHgsd commented Nov 5, 2011

I noticed there is another pull request which deals with this here: #316, which in turn is meant to satisfy #5.
I have not evaluated them side by side, but this may help those comparing.

@gourneau
Copy link

Hey Guys, can we get this in the master branch. I want this feature!

@jpsala
Copy link

jpsala commented Dec 5, 2011

Is there a way to bind this very useful functionality to another key (like ctrl-enter) in some case it can give a litle more control, do you have some thoughts about this? or something like force the user to use the add button and block the enter key, just as an option ofcourse :)?

@jimlindstrom
Copy link
Author

If more folks want that, that sounds easy enough to do. Adding code does have a cost in added complexity and risk of bugs, though, so I'm hesitant to add that feature unless sufficiently many people (whatever that means) would find it useful.

Personally, I feel like for most applications of this that I can think of ("preferred language", "country of residence", etc), I'd want (as a user) for adding new fields to be as frictionless as possible. What applications are you thinking of?

@jpsala
Copy link

jpsala commented Dec 5, 2011

I'm not sure, right now I'm using it in a little project for a girlfriend where she have to store books, the related models (to the book) are editorial, authors, genre and donner, it's a very simple application and all this related data is been added trough the plug-in, but some times she is adding some data thinking that when pressing enter is choosing data, am Ï clear?
What I mean is that is a little confuse to have the same key for choosing data and for adding it, well, I'm really not sure and want your opinion of course.
Maybe an event before the data is added? I think that could give some extra functionality, like storing the data, confirming, don't know.
What do you think?

@edrex
Copy link

edrex commented Dec 24, 2011

Hi jimlindstrom

See my comment on #316. I think the UI approach taken in that branch is cleaner.

  • In your branch, a new, diminutive UI element, the add button, is introduced. I don't think it's very discoverable to end users, and most users won't instinctively hit the "enter" key after typing in an option.
  • In Added "Add New" support as requested in issue #5 #316, an "Add new" option is added to the list of options. IMO this is more consistent and discoverable (it doesn't introduce any new UI) and I think it passes the "grandma test".

I haven't reviewed the code for either implementation in detail. If you agree with my UI assessment, and think your implementation has better code, maybe you'd want to update this branch to match the UI in #316.

See my comment for two suggested improvements to the UI.

@craue
Copy link
Contributor

craue commented Feb 3, 2012

Will this, #316, or any other approach to add a new value be included soon?

@tute
Copy link

tute commented May 16, 2012

+1 (for letting users add new tags)

@pfiller
Copy link
Contributor

pfiller commented May 26, 2012

Thanks @jimlindstrom

I'm sorry it took so long to review this. There are several other pull requests that address adding new options and I wanted to give them all a fair shake. To my eyes, it looks as though #166 and #320 are more complete options so I'm going to focus on those. Feel free to weigh in on those threads.

@pfiller pfiller closed this May 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants