Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Use Select2 on the select entity filters #64

Closed
rvanlaak opened this issue Jun 30, 2013 · 5 comments
Closed

Use Select2 on the select entity filters #64

rvanlaak opened this issue Jun 30, 2013 · 5 comments

Comments

@rvanlaak
Copy link
Contributor

When the select fields contain many entities, it is difficult to find the right option. It would be great if optionally the select2 bundle can be implemented. This great jQuery selectbox replacement makes it possible to type in the select-box.

http://ivaynberg.github.io/select2/

I've already implemented it myself now, but via a workaround instead of directly into the filter bundle. It can be an parameter in the constructor of the filter field.

@cedric-g
Copy link
Collaborator

cedric-g commented Jul 3, 2013

We use select2 on some projects but I don't think it should be integrated directly into our bundle, people should be free to choose the lib they want to use.

@webdevilopers
Copy link
Contributor

It is often discussed wheter JS libraries should be included or bound to a bundle.
Looking at SonataAdminBundle select2 has become default on Autocompleters - which is awesome!

If we consider adding select2 we needed two features:

  • auto generating the JS for the autocomplete
  • calling a controller or event that creates json data for the requested filter e.g. filter_entity

Maybe this can be achieved by an additional bundle.

If we had this feature inside THIS bundle it would be a great package since it solves a lot of use cases, would save time writing the JS and improve performance for large select fitlers.

@rvanlaak
Copy link
Contributor Author

I'm still in favor of adding select2 to this bundle by default, given that SonataAdmin did also choose for it. But it should be configurable.

Otherwise 👍 for an additional bundle, which will be a LexikFormFilterExtraBundle right? It could be suggested by the composer.json of this bundle.

@webdevilopers
Copy link
Contributor

Let's see what @cedric-g thinks. 👍

@cedric-g
Copy link
Collaborator

I still have the same opinion, but if you really think it's a good thing to provide a select2 integration feel free to submit a PR :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants