react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

How can I implement Cascading Select?

Open motro opened this issue 9 years ago • 3 comments

I'm trying to build a create form where the user has to choose a department in a way of cascading select.

Say the data is modeled like this:

  • Account
    • Company
      • Department
        • Employee

In my "Create Employee" form I want to have a cascading select for the Department so that I first have to choose the Account, then the Company filtered by the selected Account and lastly the Department filtered by the selected Company.

I tried implementing it with the filter prop on ReferenceInput and the component's state but it only works for the initial state. Any suggestions?

Thanks!

motro avatar Aug 13 '17 12:08 motro

https://github.com/marmelab/aor-dependent-input

Balipeace avatar Aug 14 '17 03:08 Balipeace

Thanks @Balipeace, but I wanted to know if there's an AOR way of doing this, one which takes into consideration the resources and applies the filters on the dependent select.

aor-dependent-input offers a possible ad-hoc implementation but is there any chance of adding such a feature soon?

motro avatar Aug 14 '17 10:08 motro

aor-dependent-input was created and is maintained by the same team as aor. We don't intend to bring it into core.

fzaninotto avatar Aug 14 '17 11:08 fzaninotto