-
Notifications
You must be signed in to change notification settings - Fork 15
Add sorting to iTwin Grid columns #192
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
base: main
Are you sure you want to change the base?
Conversation
…me for Last Modified column
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.
Pull request overview
This PR adds sorting functionality to iTwin and iModel grid table views, fixes date column labeling, and resolves several UI issues. The changes enable users to sort table columns while maintaining appropriate restrictions on non-sortable columns.
Key changes:
- Added sorting capability to iTwin and iModel grid tables
- Corrected column labels and data sources for date fields (Created Date vs Last Modified)
- Disabled sorting on favorite columns and simplified sorting implementation by removing manual sort handling
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/modules/imodel-browser/src/containers/iModelGrid/useIModelTableConfig.tsx | Disabled sorting on favorite column and refactored cell rendering for name and description columns |
| packages/modules/imodel-browser/src/containers/iModelGrid/IModelGrid.tsx | Renamed component from ITwinGridInternal to IModelGridInternal, simplified sort state management, updated column label from "Last Modified" to "Created Date", and removed manual sorting logic |
| packages/modules/imodel-browser/src/containers/ITwinGrid/useITwinTableConfig.tsx | Disabled sorting on favorite column and corrected Last Modified column to use lastModifiedDateTime instead of createdDateTime |
| packages/modules/imodel-browser/src/containers/ITwinGrid/ITwinGrid.tsx | Enabled sorting by adding isSortable prop and cleaned up documentation formatting |
| packages/apps/storybook/src/imodel-browser/IModelGrid.stories.tsx | Added aria-label to IconButton for accessibility |
| common/changes/@itwin/imodel-browser-react/omar-add-sorting-itwin-grid_2026-01-03-02-11.json | Added changelog entry for the patch release |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/modules/imodel-browser/src/containers/iModelGrid/IModelGrid.tsx
Outdated
Show resolved
Hide resolved
packages/modules/imodel-browser/src/containers/ITwinGrid/useITwinTableConfig.tsx
Show resolved
Hide resolved
…winTableConfig.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ng and update column names
|
Minor thing, but you didn't mention the table loading state (a much needed addition) in the pr description |
what was changed with the table loading state? |
| /** Generic message displayed if an error occurs while fetching. */ | ||
| error?: string; | ||
| /** Displayed on table while loading data. */ | ||
| tableLoadingData?: string; |
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.
Would it make more sense to pass a component rather than a string?
| viewMode === "cells" | ||
| ? { | ||
| sortType: "name", | ||
| descending: false, |
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'm confused on this one. Does this mean it will always be descending in tiles mode?
Uh oh!
There was an error while loading. Please reload this page.