-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi select with dynamic values doesn't load selected values on page edit #2622
Comments
@shabaz-ejaz I see the relation's name in your Piano model is called
will work fine |
@zeezo887 Thanks, I've tried that and now it doesn't actually save the the values in the pivot table. Weirdly it did save when I have it like this:
|
@shabaz-ejaz you should update your PianoRepository too
|
@zeezo887 That's what it was! That works great now thanks. |
Description
When using Multi select with dynamic values, I have got the data saving fine, however when reloading the form, the selected values are not being checked in the form by default.
Steps to reproduce
I have a pivot table which joins a
pianos
table with itself to create 'comparable_pianos'.Pivot model:
PianoController:
PianoRepository:
Blade file:
Expected result
I expect the multiselect to have pre-selected values based on the ones in the database on form edit. However I only ever see the options with all of them unchecked.
Actual result
The values do save in the database, however are not shown as selected when reading from the table int he form.
Versions
Twill version: 2.0.1
Laravel version: 7.30.6
PHP version: 7.4.33
Database engine: MySQL InnoDB
The text was updated successfully, but these errors were encountered: