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

DataTable sort feature #2590

Open
wants to merge 11 commits into
base: next
Choose a base branch
from
Open

DataTable sort feature #2590

wants to merge 11 commits into from

Conversation

hughess
Copy link
Member

@hughess hughess commented Sep 27, 2024

Description

Adds ability to define sort in DataTable code using sort, where you can pass one column and a sort direction ("asc" or "desc")

For groups (using groupBy), groups will be sorted according to subtotals where applicable.

Basic example

<DataTable data={flights} sort="fare desc"/>

CleanShot 2024-09-27 at 13 48 45@2x

Simple group example

	<DataTable {data} groupBy="category" sort="sales" subtotals=true>
		<Column id="category" />
		<Column id="item" />
		<Column id="sales" fmt="usd" />
	</DataTable>

CleanShot 2024-09-27 at 13 42 42@2x

Checklist

  • For UI or styling changes, I have added a screenshot or gif showing before & after
  • I have added a changeset
  • I have added to the docs where applicable

Copy link

changeset-bot bot commented Sep 27, 2024

🦋 Changeset detected

Latest commit: 8512eb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@evidence-dev/core-components Patch
my-evidence-project Patch
e2e-spa Patch
e2e-themes Patch
@evidence-dev/components Patch
evidence-test-environment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 27, 2024

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2024 6:55pm
next-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2024 6:55pm

Copy link

netlify bot commented Sep 27, 2024

Deploy Preview for evidence-development-workspace ready!

Name Link
🔨 Latest commit 8512eb3
🔍 Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/670c1592df13a300087c99d2
😎 Deploy Preview https://deploy-preview-2590--evidence-development-workspace.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 27, 2024

Deploy Preview for evidence-test-env ready!

Name Link
🔨 Latest commit 8512eb3
🔍 Latest deploy log https://app.netlify.com/sites/evidence-test-env/deploys/670c1592c025450008f01bec
😎 Deploy Preview https://deploy-preview-2590--evidence-test-env.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 27, 2024

Deploy Preview for next-docs-evidence ready!

Name Link
🔨 Latest commit 8512eb3
🔍 Latest deploy log https://app.netlify.com/sites/next-docs-evidence/deploys/670c1592b982fd00080ad0a0
😎 Deploy Preview https://deploy-preview-2590--next-docs-evidence.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hughess
Copy link
Member Author

hughess commented Oct 13, 2024

Last remaining issue on this:

  • Initial sort affects the data shown in the query viewer. Subsequent sorts via clicking columns do not affect it. This happens even with an explicit order by in the sql query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants