-
Notifications
You must be signed in to change notification settings - Fork 380
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(react-grid): fix colspan calculation #3471
Conversation
a20fbc4
to
ad45f4d
Compare
const chains = groupSummaryChains( | ||
tableRow, tableColumns, groupSummaryItems, firstVisibleColumnIndex, | ||
); | ||
const chain = chains.find(ch => !dataColumnGroupedBy && ch[0] === colName); | ||
const chain = tableRow.row.groupedBy ? chains.find(ch => ch[0] === colName) : undefined; |
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 have an question.
when "tableRow.type === TABLE_GROUP_TYPE", if this mean "tableRow.row.groupedBy" always have an value?
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 think if there are multiple column type which have same column name, we should get the colspan according to it's type.
Maybe we should use key of column in chains but not column name, to prevent there are mutiple chains start with same column name.
If a column is data type, the colspan of it should not be the default value 1, that will make the number of td
less than we wanted, because in some case render null
instead templatePlaceholder
in tableGroupRow plugin.
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.
Hi, @torrac12
Thank you for your interest in our product and for adding this comment to the pull request.
- Yes, the
groupedBy
property has a value whentableRow.type
isTABLE_GROUP_TYPE
. - I've made it so that column keys are used instead of the column name.
- If I understand it correctly, the colspan will not equal 1 in this case.
Fixes #3467, #3313