-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Make ReferenceManyField compatible with filters #8642
Comments
Hi @nicgirault , and thank you for your suggestion. I'm not sure I caught exactly what you are asking for. Would you like us to document how to add a FilterForm inside a Also, I'm not sure what you expect with the URL: do you expect the URL to be updated when you change the filters or not? |
Thanks for your answer. Both would be good solutions for me. Being able to have a I would expect the URL to be updated when I change filter and pagination but I guess this should be configurable. |
Thank you for your answer. However, in any case, our policy regarding new features is that we only develop them if we require them for one of our projects, or if there is a high demand for this feature from the community. Of course, you also have the ability to open a PR yourself if you are willing to give it a try. We would gladly welcome it. Thus, I'm leaving this feature request open to see how things go, but we won't work on it for now. |
Is your feature request related to a problem? Please describe.
Today there is not guidance and support for filters within a ReferenceManyField. I am having difficulties trying to integrate react-admin filter system within a ReferenceManyField component.
Describe the solution you'd like
Digging into the source code of the
List
component, it looks like the react-admin way to setup filters in ReferenceManyField would be to write something like:But this generates infinite loop when writing within a filter input (probably due to the fact that reference many field context is not exactly similar to the list context, especially in terms of URL sync settings).
Note 1: Today, ReferenceManyField pagination state is not storable in the URL and this feature request might be related to this subject: could a solution be to be able to specify a "urlKey" props to the ReferenceManyField component so that all the state of this field can be stored in URL without conflicting with possible other components?
Note 2: I am not quite sure to understand why react-admin needs to implement a
useReferenceManyFieldController
: why ReferenceManyField component can't directly use auseListController
hook instead?The text was updated successfully, but these errors were encountered: