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

Possibility to pass additional data in the server response for getList #9569

Open
AntoineCrb opened this issue Jan 7, 2024 · 1 comment
Open

Comments

@AntoineCrb
Copy link
Contributor

An API might want to send additional data since all the data isn't send when using pagination

The useListContext() hook, as documented here, provides only data and total, not additional values sent back by getList()

The solutions that could be implemented to allow this mechanism are not practical at all (feel free to explain it here if you were to find one)

I also found this stackoverflow question that raises the same issue


Here is an example using chips to show a summary of all the data (not working since the feature doesn't exist) :
Screenshot 2024-01-07 223943

@fzaninotto
Copy link
Member

This has been proposed in the past (see #4834), but the added complexity is non-negligible.

It's also possible to do it with a custom data provider method (e.g. getListMetadata). Your data provider can store the metadata from a getList response in a local cache, and return it in the getListMetadata response.

I'm open to a PR implementing this feature, but it's not an easy task, and probably not something the core team will woek on in the forseeable future.

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

No branches or pull requests

2 participants