TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
25.03k stars 3.07k forks source link

Pagination counts with extended option is wrong ?? #5408

Closed stychu closed 6 months ago

stychu commented 6 months ago

TanStack Table version

8.13.2

Framework/Library version

React 18.2

Describe the bug and the steps to reproduce it

I have a dataset comprised of events, each containing a series of changes. My goal is to represent this data within a table, where each row showcases a single event alongside its related changes. This structure should result in each event and its changes occupying a single row. However, in practice, when I attempt to display my data using an example dataset, the table incorrectly expands to show 8 rows instead of the expected 2. This discrepancy arises because it appears to count both the events and the individual changes within those events as separate rows.

This could indicate a misunderstanding on my part regarding the correct approach how to use tanstack table or possibly an issue with the pagination calculation mechanism.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://codesandbox.io/p/devbox/mystifying-austin-8v4qdv

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

KevinVandy commented 6 months ago

I can't really tell what you are trying to do, but you can always override the page count and row count values by telling the table how many pages or rows that there are https://tanstack.com/table/latest/docs/guide/pagination#page-count-and-row-count