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 3 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 ❌ Failed (Inspect) Nov 8, 2024 10:10am

@acharlop acharlop marked this pull request as draft November 8, 2024 10:17
@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?

@@ -3,23 +3,67 @@ title: TanStack Table Parsers
description: Store your table state in the URL, with style.
---

import { TanStackTableFiltering } from './tanstack-table-filtering.generator'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: that import doesn't exist and causes the build to fail.

Suggested change
import { TanStackTableFiltering } from './tanstack-table-filtering.generator'

@franky47 franky47 added documentation Improvements or additions to documentation parsers/community Related to community parsers labels Nov 13, 2024
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