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

[TypeScript] add setParams in ListContext #9340

Closed
wants to merge 1 commit into from

Conversation

mchaffotte
Copy link
Contributor

Problem

In some situations you might want to change multiple parameters on the ListContext (ex: sort & filter). Currently, you have to call two methods: setFilter and setSort. However, this sometimes fail to apply both results and you loose one of them (Calling setSort and setFilters after one another filckers and doesn't setSort · Issue #4189 · marmelab/react-admin ). There are workaround but they are not always available (you can’t always use the navigation API, e.g ReferenceManyField)

Solution

Add a setParams function that accepts the getList payload pagination, sort and filter).

Make sure to update all components that implements ListContext (in enterprise too)

To be added in:

use ListController
useList
useReferenceManyFieldController
useReferenceArrayInputController
useReferenceManyInputController
useReferenceManyToManyInputController

@fzaninotto
Copy link
Member

Superseded by #9638

@fzaninotto fzaninotto closed this Feb 3, 2024
@fzaninotto fzaninotto deleted the list-context-set-params branch June 20, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants