How do I get the total count?
`
data
:
[{id: 0, subscription_id: "S-20240613-0000018", member_id: "dong25", member_name: "윤동25",…},…]
page
:
1
total
:
6
`2 Replies
Hi @florent. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To get the total count of data when using the
useDataGrid
hook in refine, you can utilize the rowCount
property from the dataGridProps
returned by the hook. The rowCount
value is fetched using the useList
hook.
Here is how you can access the total count:
In this example, dataGridProps.rowCount
will give you the total number of data items.
For more details, you can refer to the documentation on the rowCount
property:
- rowCount (https://refine.dev/docs/ui-integrations/material-ui/hooks/use-data-grid#rowcount)
If you need to understand how the useList
hook works to fetch this data, you can refer to:
- useList (https://refine.dev/docs/data/hooks/use-list/)
This should help you retrieve and utilize the total count of data in your application.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1184365192482652173> kapa.ai is still learning and improving, please let us know how it did by reacting below