Question about fetching paginated table data for a .csv export
Hey @Omer , another question if I may.
I have a table which will return quite a few records. The table is paginated for obvious reasons.
My idea was when they click my button => to get the tableQueryResult.data?.data and then iterate over that to create my data to send to the backend to make the .csv file.
Sounds greeat! however in practice, the tableQueryResult.data?.data is only returning the first 50 out of 1500 results.. not the entire resource..
Do i have to create a endpoint to return the unpaginated data .. or can i handle this in refine?
I'm kinda stumped as to what to do here, any advice or ideas would be greatly appreciated!
Thank you!
6 Replies
Hey @ben_g. ๐ ,
correct-apricotโข3y ago
Hey! @Omer ๐
You can use
hasPagination
prop of useTable. So you can handle this in your dataProvider โก
https://github.com/pankod/refine/blob/next/packages/simple-rest/src/index.ts#L104GitHub
refine/index.ts at next ยท pankod/refine
Build your React-based CRUD applications, without constraints. - refine/index.ts at next ยท pankod/refine
correct-apricotโข3y ago
Thanks @Omer so like make a custom prop that returns the unpaginated data as well ? is that sort of what you might do?
You're welcome ๐ป How you handle this will depend on your API design ๐ฏ
correct-apricotโข3y ago
hmmmm yep ok i'll go and have a think, thanks again!