You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@BakiVernes fantastic component! thank you for sharing.
I'm trying to convert the following list of check_boxes to multiselect with default selections (as seen below, using checked). I tried experimenting with the traditional selected attribute without luck.
Perhaps I'm missing something subtle that could be added to documentation. Thanks in advance!
In my example above I'm using the session to preserve the value.
The text was updated successfully, but these errors were encountered:
joshRpowell
changed the title
Examples of setting defaults and using session values
Examples of setting defaults
Dec 1, 2022
Thank you @joshRpowell for trying out our component. Indeed, the documentation is lacking in that regard and we will fix it. In the mean time here is the solution:
On the element that has the data-controller="multiselect" attribute add the following json array data-multiselect-selected-value="[{ "text": "Active", "value": 1 }]"
@BakiVernes thanks for the quick response. Your suggestion works great! Working as expected. Thank you! Let me know if there is a direction you have in mind with documentation, I'd be happy to collaborate.
Since you seem interested I think it would be good to mention preselected values in the Good to know section of the documentation. I'll close this issue when you contribute. Thank you!
@BakiVernes fantastic component! thank you for sharing.
I'm trying to convert the following list of
check_boxes
to multiselect with default selections (as seen below, usingchecked
). I tried experimenting with the traditionalselected
attribute without luck.Perhaps I'm missing something subtle that could be added to documentation. Thanks in advance!
In my example above I'm using the session to preserve the
value
.The text was updated successfully, but these errors were encountered: