Sorting by Group Value #2428
Unanswered
dsoffiantini
asked this question in
General
Replies: 2 comments
-
@dsoffiantini I am looking for a way to do the same. I group a column A and column B sums up the integers within that group. If I now sort column B it will consider all the subRows, too. However, this behaviour is slightly confusing for the user who would rather want to sort by the grouped sum. Were you able to figure out if this is possible? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is a question, so converting it to discussions. Feel free to use the discord server too! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to combine useSortBy and useGroupBy hooks in order to sort by the currently selected group? Currently, I have the grouped value in a separate column where I use the Aggregate function to pull out the groupByVal and display it to the user, like so:
Aggregated: ({ row: { isExpanded, groupByVal } }) => { return ( <span> {isExpanded ? ( <IconKeyboardArrowUp className="expand-collapse" /> ) : ( <IconKeyboardArrowDown className="expand-collapse" /> )} {groupByVal} </span> ); }
However, I'm not sure how I can get out the groupByVal into a way where it is sortable, since the accessor is dynamic based on the table state.
Beta Was this translation helpful? Give feedback.
All reactions