Skip to content
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

doc: tanstack-table refactor pagination example code, and add sorting #748

Draft
wants to merge 7 commits into
base: next
Choose a base branch
from

Conversation

acharlop
Copy link

@acharlop acharlop commented Nov 8, 2024

I'm working on this now for my own project so figured I'd help out and add documentation.

Please let me know if this is helpful and heading in the right direction and I'll continue to add the filtering and a playground.

Copy link

vercel bot commented Nov 8, 2024

@acharlop is attempting to deploy a commit to the 47ng Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Nov 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuqs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2024 9:37pm

@franky47
Copy link
Member

franky47 commented Nov 8, 2024

Thanks!

The idea behind community parsers is to highlight how to leverage custom parsers to represent data structures in the URL in a nice way. One thing you could try is to format the URL to only show the id and direction, like ?sort=name.asc or ?sort=age:desc.

The playground is an interactive way of configuring the parsers, variables here could include:

  • The separator (., :, ~ would be good choices, making sure to encode any instance of it in the id)
  • The rendering of the direction: asc | desc, a | d, ^ | v

Does TanStack Table support sorting over multiple columns? Is this something we could support by combining it with parseAsArrayOf?

@franky47 franky47 added documentation Improvements or additions to documentation parsers/community Related to community parsers labels Nov 13, 2024
@acharlop acharlop force-pushed the tanstack-table-docs branch from 3f961f9 to 870fb47 Compare November 30, 2024 21:30
@acharlop
Copy link
Author

@franky47 I've updated the pagination example with 2 different strategies, and if that works for you I'll do the same for the sorting as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation parsers/community Related to community parsers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants