Skip to content
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

Data display with optionsDependOn #236

Open
visavi opened this issue Sep 1, 2023 · 0 comments
Open

Data display with optionsDependOn #236

visavi opened this issue Sep 1, 2023 · 0 comments

Comments

@visavi
Copy link

visavi commented Sep 1, 2023

Data output problem
I have 2 lists, resorts and hotels
if their IDs are the same, then a list of resorts is always displayed
Everything is saved correctly in the database, but the names are displayed incorrectly

Multiselect::make('type', 'type')
    ->options([
        'resort' => 'Resort',
        'hotel' => 'Hotel',
    ])
    ->singleSelect(),

Multiselect::make('values', 'values')
    ->optionsDependOn('type', [
        'resort' => [
            1 => 'Resort 1',
            2 => 'Resort 2',
            3 => 'Resort 3',
        ],
        'hotel' => [
            1 => 'Hotel 1',
            2 => 'Hotel 2',
            3 => 'Hotel 3',
        ]
    ])
    ->saveAsJSON(),

It turns out that it will work well only if the id of the resorts and hotels are different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant