How to tell the front-end how many items the list has?
I imagine that in the listing the number of pages is done through a parameter for the number of items displayed in the header. But what is this parameter? Is there anywhere in the documentation that talks about this?
![No description](https://cdn.answeroverflow.com/1152102747609497710/image.png)
3 Replies
Hi @yepmad. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, you're correct. In refine, the number of items displayed per page in a list or table view is controlled by a parameter called
pageSize
. This parameter is part of the pagination functionality provided by refine.
For example, in the Material UI DataGrid component, you can set the pageSize
property to control the number of rows displayed per page. Here's an example from the refine blog (https://refine.dev/blog/mui-datagrid-refine/):
In this example, pageSize
is set to 5, meaning that 5 rows will be displayed per page.
You can also define how many rows the user can choose to view per page using the rowsPerPageOptions
prop:
In this case, the user can choose to view 5, 10, or 20 rows per page.
For more information on pagination in refine, you can refer to the refine documentation (https://refine.dev/docs/packages/documentation/react-table/).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@331304553641279490> kapa.ai is still learning and improving, please let us know how it did by reacting below
helpful-purple•12mo ago
Oh, I figured out. It's in the body.
![No description](https://cdn.answeroverflow.com/1152104823903232010/image.png)