Select2 issues
Select2 issues
Hi all,
I've set up Select2 and now I'm facing the following issues:
1..When I've selected some options and clicked on "Update", these options are saved and are visible in DataTables. Fine. When I open the Editor on this entry without touching anything in the dropdown and click "Update" then every option previously selected is being removed (from the DB too...). In other words, every time I open the Editor on this entry I have to select again the options I want, which is bothering. Is there a way to prevent this behavior?
2..My items in the dropdown are long lines, so the tag view is not very convenient . Is there another way to show the options, e.g. line by line ideally with a slider?
3..My items in the dropdown can be some hundreds. Is it possible to hide the options that I've already selected in the dropdown?
Answers
When I use a local variable for the options instead of another DB column like this:
then issue nr.1 does not appear i.e. the options I've previously selected are not being removed every time I open the Editor for this item.
I think I solved my first issue...
When the options in the DB column are like this:
they are read as as string like this:
if I now convert this to an Array like this:
then they get written like this in the DB:
when selected.
I find this format weird, but at least they don't get removed. This without the separator activated. If I activate the separator with comma, like this:
then they get removed again.