PUGX / PUGXAutoCompleterBundle

Add an autocomplete field to your Symfony forms
GNU Lesser General Public License v3.0
93 stars 38 forks source link

Confusion with LexikFormFilterBundle usage #75

Closed Mecanik closed 2 years ago

Mecanik commented 3 years ago

Hello,

A bit of a noob question (but since I'm quite new to Symfony, forgive me). I`m trying to create an auto-complete select box for a project where users can search addresses.

I have followed the documentation up until here, however I`m a bit confused of the usage.

My understanding was and is that if I use LexikFormFilterBundle with your library it would search from the entity/database without the need to have a separate controller. However, I can see that the library still tries to perform GET requests to a controller.

Is this the desired result and I am missing something? Please advise.

Thank you!

garak commented 3 years ago

This library is using two additional controller actions: one to search for values, and another one to display the currently selected value (if there's one). If you want to just use it like a select2 with existing values, these actions are actually not needed, since all values are already present. Notice that this is not advisable if you estimate to have a long list of values.

Mecanik commented 3 years ago

This library is using two additional controller actions: one to search for values, and another one to display the currently selected value (if there's one). If you want to just use it like a select2 with existing values, these actions are actually not needed, since all values are already present. Notice that this is not advisable if you estimate to have a long list of values.

Thank you! So it is necessary to have URL's for searching/display unless using select2. I would use select2, but my list is.... 2 million records.

Anyway thank you for clarifying this. One last question, I tested with URL's for searching and I noticed the results are not displayed in the select box; but rather somewhere else on the page (which is weird).

I`m using BS5, is there anything I must do additionally to display a nice dropdown-select box? (maybe I understood this library wrong)

garak commented 3 years ago

I`m using BS5, is there anything I must do additionally to display a nice dropdown-select box? (maybe I understood this library wrong)

There's no template in this bundle, the render is up to you and to the library you chose (e.g. select2 or jquery-ui).

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue is closed because was marked as stale and had no activity. Thank you for your contributions.