DataGrid: Fix the banded Columns' vertical borders (T1318812)#32802
DataGrid: Fix the banded Columns' vertical borders (T1318812)#32802Alyar666 wants to merge 23 commits intoDevExpress:26_1from
Conversation
88936f8 to
ccd2691
Compare
packages/devextreme/js/__internal/grids/grid_core/column_headers/m_column_headers.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts
Show resolved
Hide resolved
ccd2691 to
2899a74
Compare
77856d4 to
d98ceff
Compare
04062b7 to
a784fb8
Compare
packages/devextreme/js/__internal/grids/grid_core/column_headers/m_column_headers.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/column_headers/m_column_headers.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/column_headers/m_column_headers.ts
Outdated
Show resolved
Hide resolved
be6ac0c to
f9562be
Compare
packages/devextreme/js/__internal/grids/grid_core/column_headers/m_column_headers.ts
Outdated
Show resolved
Hide resolved
… selectors The border-left/border-right rules for multi-row headers incorrectly targeted all .dx-row elements inside the headers container. This caused filter row cells to get unexpected borders when band columns were present and showColumnHeaders was false. Narrowing the selector to .dx-header-row ensures only actual header rows are affected.
packages/devextreme/js/__internal/grids/grid_core/__tests__/__mock__/model/grid_core.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/__tests__/__mock__/model/grid_core.ts
Show resolved
Hide resolved
| protected needToUpdateFirstCellClasses(): boolean { | ||
| const hasHidingColumnsQueue = !!this._adaptiveColumnsController | ||
| ?.getHidingColumnsQueue()?.length; | ||
|
|
||
| return hasHidingColumnsQueue; | ||
| } |
There was a problem hiding this comment.
needToUpdateFirstCellClasses() only checks getHidingColumnsQueue().length. When adaptivity has already hidden columns (e.g. _hiddenColumns is non-empty) or when columns are being shown back (queue can be empty), the first-cell class may still need recalculation, but this method will return false and skip updates. Consider also checking this._adaptiveColumnsController?.hasHiddenColumns() (or another reliable signal that the first visible column may have changed).
…ers (T1318812) - Override _getVisibleColumnIndex in ColumnHeadersView to pass rowIndex to getVisibleIndex - Type _getVisibleColumnIndex signature across base and derived classes - Fix _getCellElement to handle missing cells with fallback to empty jQuery set
| protected updateFirstCellClasses(): void { | ||
| const rows = this._getRows(); | ||
|
|
||
| rows.forEach((row, index) => { | ||
| const rowIndex = row.rowType === 'header' ? index : null; | ||
| const firstColumn = this._columnsController.getFirstColumn(rowIndex); | ||
|
|
||
| if (firstColumn) { | ||
| const $cell = this._getCellElement(index, `index:${firstColumn.index}`); | ||
|
|
||
| this.toggleFirstCellClass($cell, true); | ||
| } | ||
| }); |
There was a problem hiding this comment.
updateFirstCellClasses only toggles the first-cell class on the new first column, but it never removes the class from the previously-first cell in each row. After multiple visibility/width changes (e.g., column hiding/unhiding in adaptive mode), multiple cells in the same row can keep dx-*-first-cell, which will break border logic. Consider clearing the first-cell class for all cells in the row first (or tracking the previous first column and toggling it off) before enabling it for the current first column.
| .dx-rtl .dx-#{$widget-name}-headers.dx-header-multi-row .dx-header-row:not(.dx-column-lines) > td:not( | ||
| .dx-#{$widget-name}-first-cell, | ||
| .dx-#{$widget-name}-hidden-column, | ||
| .dx-command-adaptive-hidden | ||
| .dx-#{$widget-name}-sticky-column-border-right, | ||
| .dx-#{$widget-name}-column-no-border | ||
| ) { |
There was a problem hiding this comment.
In the RTL multi-row header selector, the :not(...) list is missing a comma after .dx-command-adaptive-hidden. As written, it becomes a descendant selector (.dx-command-adaptive-hidden .dx-...-sticky-column-border-right) instead of two separate exclusions, which will produce incorrect border rules in RTL (and may invalidate the selector in some preprocessors). Add the missing comma so all exclusions are separate selectors.
| for (const { rowIndex, cells } of expectedRows) { | ||
| const summaryRow = dataGrid.getFooterRow(); | ||
|
|
||
| // eslint-disable-next-line no-restricted-syntax | ||
| for (const { columnIndex, name, expected: [leftWidth, rightWidth] } of cells) { | ||
| const element = summaryRow.child('td'); | ||
|
|
||
| const borderLeft = await element.getStyleProperty('border-left-width'); | ||
| const borderRight = await element.getStyleProperty('border-right-width'); | ||
|
|
There was a problem hiding this comment.
checkSummaryCellBorders ignores rowIndex and columnIndex: it always reads styles from summaryRow.child('td') (the first footer cell). This makes the helper incorrectly validate only the first summary cell even when multiple columns are provided. Use the columnIndex to select the correct cell (e.g., summaryRow.child('td').nth(columnIndex) / find('td').nth(...)) and, if multiple footer rows are possible, also use rowIndex.
No description provided.