Multi-Select field type (or other options) in Editor?
Multi-Select field type (or other options) in Editor?
I have a very large amount of options (array) for a few various fields. Checkboxes work, but are cumbersome to scroll through. Select only allows a single selection. Are there any other options for a large array in an Editor field?
Something else that would be handy either in conjunction with the above or on its own would be the ability to populate via a search. e.g. start typing and display matching options, similar to the search function in DataTables.
Thanks!
This discussion has been closed.
Answers
There are two that I know of here:
https://editor.datatables.net/plug-ins/field-type/
Selectize and Select2. I've used select2 and it works pretty good. I think with either you can type in the select input and filter the options shown.
Kevin
Another option is the built in
select
field type'smultiple
option. It uses a simpleselect
element. Select2 and friends, as suggested by Kevin are an excellent step up from that, but they do also add a little more complexity.Allan
Having some issues using the multiple option (Namely it is sending:
So, whilst I troubleshoot that, I'm looking at Select2 and Chooser...really like the Pillbox feature of both of them which would solve a bunch of issues for me.
However, I'm too dense to figure out how to implement and integrate either of these options. Is there a How-To-For-Dummies walkthrough available anywhere? thanks,
Good news: Got multi-select working properly with the normal select. Also, got Select2 implemented and mostly working! (look at that folks, you can teach an old dog!)
Not-as-good news: Multi-select with Select2 is operating as a single-select (single selects work fine).
example editor field:
Also, this is very minor...but on load of the editor modal window, the first Select2 dropdown displays already dropped-down.
You have
multiple
twice in the config. Probably doesn't hurt anything though. But with Select2 you may need to useopts
object for the multiple option. Here is an example of what I use:I haven't run into this. Maybe others have ideas.
Kevin