Editor multiple select without array

Editor multiple select without array

asleasle Posts: 119Questions: 31Answers: 0

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

  • allanallan Posts: 64,658Questions: 1Answers: 10,689 Site admin

    The select field type has a separator option which allows it to work with string based data for multiple values. Set its multiple option to true and separator 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 of tags with multiple selection available here.

    Allan

  • asleasle Posts: 119Questions: 31Answers: 0
    edited June 19

    Thanks Allan, I think the multiple option for the select fielddoes 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!

  • allanallan Posts: 64,658Questions: 1Answers: 10,689 Site admin

    With separator specified as a comma, it should also work on the list. Good to hear that select will do the job for you though.

    Allan

Sign In or Register to comment.