-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix: assign parentId to subRows when creating aggregatedRows #4882
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -118,6 +118,10 @@ export function getGroupedRowModel<TData extends RowData>(): ( | |||||||||||
}) | ||||||||||||
|
||||||||||||
subRows.forEach(subRow => { | ||||||||||||
if (!subRow.parentId) { | ||||||||||||
Object.assign(subRow, { parentId: id }); | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, this also introduces a bug where the table will crash after ungrouping by a column. Needs to be looked into more, but this will be part of the solution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch Kevin. I was so focused on the solution for my current use-case that I forgot about ungrouping 😢 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking into it, we have to find a way to remove the parentId as we ungroup. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to navigate this code, trying to follow the same approach for how the
So, I have couple questions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For what is worth: assigning/un-assigning |
||||||||||||
} | ||||||||||||
|
||||||||||||
groupedFlatRows.push(subRow) | ||||||||||||
groupedRowsById[subRow.id] = subRow | ||||||||||||
// if (subRow.getIsGrouped?.()) { | ||||||||||||
|
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.
Thank for update