Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Allow new values (for collections) #38

Closed
wants to merge 2 commits into from

Conversation

tandibar
Copy link

Introduced a new attribute 'allow'new'values'. If this is set to true, it is possible to select values which do not exist in the choices. This is helpful if you want the user to be able to create new entries on the fly.

It is really great that you ported select2 to native angular. I was not able to get this behavior in select2 with the angular-ui-select2 library.

It would be possible to make this available for complex objects (not just collections) as well. One idea would be to specify a function which will be called with the search string which then returns an object. Let me know if you would like to see this. I am not sure if there are cases where this makes sense.

@malexandre
Copy link

This function is nice, I actually made something like it with ui-select2, but I needed to create the new item when I selected it, not when I saved the form. I think it would be nice to add an attribute to your code to pass a function to execute with a new value selected, because I might not be the only one to need to execute some specific code for a new value.

@ProLoser
Copy link
Member

I would just call this option 'tagging' for conciseness

@dimirc
Copy link
Contributor

dimirc commented Oct 10, 2014

Let's continue the discussion of this feature at #260

@dimirc dimirc closed this Oct 10, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants