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

4001 - Datatable use Datagrid - Cell borders #4199

Conversation

yaguzmang
Copy link
Contributor

image image

image image

image image

ODP Header in print:

image

@yaguzmang yaguzmang self-assigned this Jan 7, 2025
@yaguzmang yaguzmang marked this pull request as ready for review January 7, 2025 00:22
/>
))}
{cols.map((col, colIndex) => {
const lastCol = colIndex === cols.length - 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can column count passed as prop be different than cols.length-1?(can we use one variable only ?)

Also , are lastSpanningCol and lastSpanningRow needed ?
With colSpan taken from Cols.getStyle and be default =0:
Lastcol = (colIndex + colSpan)===colsLength (see first point)
Can this work ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it not even Lastcol = (colIndex + colSpan)===colsLength is needed, because really whichever col is last in the data row array should always be lastCol, regardless of the span. The only way that wouldn't apply is if we have a row that has columns with spans that don't add up to the col count of the table, but that would be a data issue.
It's similar when lastRow= index === rowsData.length - 1 , there is no need to check the spans for the last data row, as the cells there should always have lastRow=true.

lastSpanningRow is necessary though because you could have a cell in the middle of the table that spans down to the last row. Unlike lastSpanningCol where a cell in the middle can't span to the last column.

@mergify mergify bot merged commit a2f5774 into 4001-datatable-use-datagrid Jan 7, 2025
5 checks passed
@mergify mergify bot deleted the 4001-datatable-use-datagrid-spanning-cell-borders branch January 7, 2025 19:09
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.

2 participants