Editor multiple select without array
Editor multiple select without array
I have converted a large database to DataTables where one field is a list of municipals like thie "Oslo, Luster, Bremanger". I want to be able to edit the field "Kommune" with a drop down list of all available municipals. The problem with using the solution like in "Multiple Select" is that I can not use the already entered values since the field relies on an array of items while my fields are only comma-separated text. I want to be able to do things like in this multi-select dropdown list So I would like to choose from a populated select dropdown and clicking an item adds it to the input separated with comma. Does anyone have an example of this or must I write this outside Datatables?
Replies
The
select
field type has aseparator
option which allows it to work with string based data for multiple values. Set itsmultiple
option totrue
andseparator
to be a comma.The same applies to
tags
which is a bit more like the demo you linked to with a dropdown list that can be searched etc. Demo oftags
with multiple selection available here.Allan
Thanks Allan, I think the
multiple
option for theselect field
does exactly what I want for this field! The tags field seems to make an array so it would not work on the old records. But very nice anyway!With
separator
specified as a comma, it should also work on the list. Good to hear thatselect
will do the job for you though.Allan