-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Adding new options on the fly #520
Conversation
Thanks, great feature, works perfectly on my end, so please merge. |
+1 |
changes should be done in the CoffeeScript source, not in the compiled JS code (your changes would be lost ont eh next compilation otherwise). And according to the contributing rules, changes must be applied to both the jQuery and the Prototype implementations to be accepted. |
Btw, this implementation is bad as it does not notify when a new option is added, letting the user add the option he wants in a select without giving a chance to execute some logic to make the choice valid (for instance doing a query to the server to add the option as a valid choice). See #5 for the feature request and #166, #316, #320 and #326 for alternate implementations (which are more complete and implemented in coffeescript) |
Like @stof says, pull request that have changes made directly in the JS will never get merged. And you have to make the changes for both the jQuery version as the the Prototype version. Like stated in the README:
|
btw, I don't think it is worth it reimplementing your PR in CoffeeScript as the implementation in #166 is better IMO |
Thanks @shezarkhani As @stof mentions, #166 seems to be a more complete way of handling this feature request so closing in favor of that. |
Added a new option "add_new_options". If it is set, when a result is not found chosen will treat the new entry as an option and adds it to the selected list. work both on multiple select and single select.
e.g.
$('#.chosen-select').chosen({add_new_options: true});