Sonataadminbundle: Add support for `add` button in `sonata_type_model_autocomplete`

Created on 28 Aug 2014  路  34Comments  路  Source: sonata-project/SonataAdminBundle

feature

Most helpful comment

@quiquegarcia thanks for your feedbacks. I'll make a PR soon 馃槃

All 34 comments

+1

:+1:

:thumbsup:

Any news on this @pulzarraider ?

Original issue:
https://github.com/sonata-project/SonataAdminBundle/issues/530

:+1:

:thumbsup:

+1

:+1:

This would be great as possibility. I need this now for my project but can't get it to work in my sonata admin edit form for entity. To allow user to select tag from autocomplete or add new one. Something like Select2 with tagging support or similar to this: http://textextjs.com/manual/examples/autocomplete-with-tags.html

:+1:

_bump_

Anyone a proper solution for this (or quickfix)?

+1 will be very usefull

I guess this is scheduled for after _2.4_, right @pulzarraider ?

:+1:

:+1:

:+1:

Hello,

I've created a quick fix for a project of mine, in order to allow add button in autocomplete fields. You can see it here : https://gist.github.com/npotier/a7b2b34f0daae7205f86.

Hope this helps

:+1:

@npotier Why template added in array doesn't work? I get an error: The option "template" does not exist. Defined options are: ...

@npotier could you provide your fix as a PR?

hi @OskarStark thanks for your message. I could make a PR, but i'm not sure how to propose a definitive solution:

  • should I add an "allow_add" option to the ModelAutocompleteType ?
  • should I create a new Type ModelAutocompleteTypeWithAdd ?
  • should I just PR the template file and add in the documentation an entry to show how to configure the form Admin when you want the "add" feature ?

What do you guys think ?

thanks for your answer @npotier, IMO this would be the best solution:

should I add an "allow_add" option to the ModelAutocompleteType ?

ping @sonata-project/contributors

ok ! i'll wait for other opinions from others and make the PR in a few days

Definitely :+1: for "allow_add" option.

i think you can start the PR :smile: :smile:

You should wait for @pulzarraider and @rande - they are "the voice"! ;)

@npotier a PR would be great, if no one else raised there hands :smile:

That's indeed a feature Sonata is highly lacking.
Another great thing would be to be able to add an entity when there is no result to the typed text!

Another great thing would be to be able to add an entity when there is no result to the typed text!

We did this with selectize in our project instead of select2, because select2 was a bit to complicated for this.

I can't find a doc for that, where can I find it? Thanks ;)

@npotier PR please!

@quiquegarcia thanks for your feedbacks. I'll make a PR soon 馃槃

PR Created ;)

PR is ready to merge, functionality will be available soon ;)

Was this page helpful?
0 / 5 - 0 ratings