XF 2.3 When 'select' list is huge

Anatoliy

Well-known member
I'm developing an add-on (slightly modified version of Notes from 'Building with XF2' videos), so my members could create fishing notes.
I decided that it's a good idea to add to a form a select field 'Waterbody' for members convinience (so they don't have to type in a river/lake name they fished, but instead to select from a list). The problem is that the list is huge. And they have to scroll and scroll and scroll to find the waterbody. Very inconvenient.

Is there a way to solve this?

May be by adding this list to user preferences, where they can uncheck waterbodies they don't fish and a select field in a form would display to each user only those waterbodies they left checked? If it's possible - push me in a right direction please cause I have no idea where to move.
 
The usual pattern for dealing with this is a combobox, but we don't ship a combobox component in the core. We do ship Tagify which has some support for this, but you'd have to create the JS binding yourself.
 
The usual pattern for dealing with this is a combobox, but we don't ship a combobox component in the core. We do ship Tagify which has some support for this, but you'd have to create the JS binding yourself.
Thanks for reply. That tagify thing looks cool, however it's not for my case. It designed to allow adding several tags. In my case it's always a single value. A user posts a fishing note, where there are Date, Time (from/till), Catch(what spicies and how many, textbox for comments, and a Waterbody (river/lake name where he fished).

Hmm... After looking at that tagify, I realized that XF suggests me threads, when I'm trying to create a new thread. May be I too in my addon instead of a dropdown with hundred elements implement a textfield, that suggests allowed Waterbody names after a user starts to type in?

Is it possible?
And how 🥸
 
In my case it's always a single value.
The part I linked is specifically for a single value (at the bottom of the page). I haven't used it personally, but in any case some kind of combobox is likely what you want.
 
The part I linked is specifically for a single value (at the bottom of the page). I haven't used it personally, but in any case some kind of combobox is likely what you want.
in Michael Jackson voice: it's close to miiiiidniiiight

maybe I better look at this in the morning )
I don't understand how the Tagify's single value select will help me. it will have the same huge list of predefined options as a standard html select field has now.
 
They start typing, it starts suggesting from the list.
Oh, that's different. In that example I click in the field, the list appears...
I'll look again in the morning after couple cups of coffee. )

Thanks for your help, Jeremy.
 
Back
Top Bottom