-
Notifications
You must be signed in to change notification settings - Fork 615
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
feat(Table): add support for pagination & initialState #3065
Conversation
src/runtime/components/Table.vue
Outdated
@@ -169,6 +175,8 @@ const tableApi = useVueTable({ | |||
...(props.expandedOptions || {}), | |||
getExpandedRowModel: getExpandedRowModel(), | |||
onExpandedChange: updaterOrValue => valueUpdater(updaterOrValue, expandedState), | |||
getPaginationRowModel: getPaginationRowModel(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not break all existing examples? I already tried this when I made the component but this enables the pagination just by passing getPaginationRowModel
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested the examples locally and they're working as expected. Can you elaborate more on how they break?
commit: |
One thing to note is that this works for Client Side Pagination; for Server-Side pagination, one would need to pass This made me think that we should let the table component accept all of What do you think? @benjamincanac |
Yes that would be better indeed, initially I was planning to add props one by one to document each feature. |
Would you like me to do it in this PR? |
98df452
to
3320e04
Compare
Sorry for the delay I just noticed the reaction on the comment today @benjamincanac. I've tried implementing this but faced an error when extending the props which led me to use workarounds to make it work. I opened #3177 to discuss it. |
@MuhammadM1998 Maybe we can merge this first? π€ |
I've force-pushed the v3 to this branch so all changes are lost π. I could reimplement them easily but note that pagination with Tanstack can involve one or more of these options used together This PR only adds support for |
π Linked issue
Part of #2441
β Type of change
π Description
This adds Pagination support for the table component. I've been waiting on #2654 but it's been a draft for some time. I've also added support for initialState to allow users to pass default options to the table, such as page size.
π Checklist