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

fix(react-grid): fix colspan calculation #3471

Merged
merged 3 commits into from
Jan 17, 2022

Conversation

Krijovnick
Copy link
Contributor

@Krijovnick Krijovnick commented Dec 30, 2021

Fixes #3467, #3313

@Krijovnick Krijovnick self-assigned this Dec 30, 2021
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;
Copy link

@torrac12 torrac12 Jan 5, 2022

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?

Copy link

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.

Copy link
Contributor Author

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.

  1. Yes, the groupedBy property has a value when tableRow.type is TABLE_GROUP_TYPE.
  2. I've made it so that column keys are used instead of the column name.
  3. If I understand it correctly, the colspan will not equal 1 in this case.

@Krijovnick Krijovnick merged commit 5c44427 into DevExpress:master Jan 17, 2022
@Krijovnick Krijovnick deleted the fix_colSpan branch January 17, 2022 08:14
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.

colspan wrongly set in group summaries cell, which cause incorrect alignment
3 participants