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

3 or more dependend selects > not resetting correctly #11

Open
preliot opened this issue May 16, 2019 · 3 comments
Open

3 or more dependend selects > not resetting correctly #11

preliot opened this issue May 16, 2019 · 3 comments

Comments

@preliot
Copy link

preliot commented May 16, 2019

I've got multiple selects depending on eachother. Simplified example:

client
location
department
user

User depends on department, department on location and location on client.

Bug

  1. Select a (dependend) value in each select
  2. Change the selected option in client (first select)
  3. Location is properly resetted and department disabled.
  4. User however still has the old values
@dillingham
Copy link
Owner

code?

@preliot
Copy link
Author

preliot commented May 16, 2019

\Laravel\Nova\Fields\BelongsTo::make('Distributor', 'distributor', DistributorResource::class)
                ->rules('required');

\NovaAjaxSelect\AjaxSelect::make('Client', 'client_id')
                    ->get(config('nova.path') . "/orglevel/distributors/{distributor}/clients")
                    ->parent('distributor');


\NovaAjaxSelect\AjaxSelect::make('Location', 'location_id')
                    ->get(config('nova.path') . "/orglevel/clients/{client_id}/locations")
                    ->parent('client_id');


\NovaAjaxSelect\AjaxSelect::make('Department', 'department_id')
                    ->get(config('nova.path') . "/orglevel/locations/{location_id}/departments")
                    ->parent('location_id');

\NovaAjaxSelect\AjaxSelect::make('User', 'user_id')
                    ->get(config('nova.path') . "/orglevel/departments/{department_id}/users")
                    ->parent('department_id');

Updated the code and changed the formatting. When i select all values and reset:

  1. Distributor -> client is resetted and location disabled. Department and User are not changed.
  2. Client -> location is resetted and department disabled. User is not changed.

@preliot
Copy link
Author

preliot commented May 30, 2019

@dillingham If you have the time, can you confirm that this is a legit bug? Or if it's not?

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

2 participants