Skip to content

Commit 7e9a51e

Browse files
author
Alyar
committed
DataGrid: simplify first-cell class update logic (T1318812)
- Remove needToUpdateFirstCellClasses check from adaptivity resizing - Remove showColumnLines gate from column headers _createCell - Remove needToUpdateFirstCellClasses method from ColumnsView
1 parent b1c175a commit 7e9a51e

3 files changed

Lines changed: 2 additions & 10 deletions

File tree

packages/devextreme/js/__internal/grids/grid_core/adaptivity/m_adaptivity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ const resizing = (Base: ModuleType<ResizingController>) => class AdaptivityResiz
13261326
COLUMN_VIEWS.forEach((viewName) => {
13271327
const view = this.getView(viewName);
13281328

1329-
if (view?.isVisible() && view?.needToUpdateFirstCellClasses()) {
1329+
if (view?.isVisible()) {
13301330
view.updateFirstCellClasses();
13311331
}
13321332
});

packages/devextreme/js/__internal/grids/grid_core/column_headers/m_column_headers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,14 @@ export class ColumnHeadersView extends ColumnContextMenuMixin(ColumnsView) {
359359
const { column } = options;
360360
// @ts-expect-error
361361
const $cellElement = super._createCell.apply(this, arguments);
362-
const showColumnLines = this.option('showColumnLines');
363362

364363
if (options.rowType !== 'header') {
365364
return $cellElement;
366365
}
367366

368367
const rowCount = this.getRowCount();
369368

370-
if (!showColumnLines && rowCount > 1) {
369+
if (rowCount > 1) {
371370
this.toggleFirstCellClass(
372371
$cellElement,
373372
this._columnsController.isFirstColumn(column, options.rowIndex),

packages/devextreme/js/__internal/grids/grid_core/views/m_columns_view.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,13 +1516,6 @@ export class ColumnsView extends ColumnStateMixin(modules.View) {
15161516
$dragContainer.text(column.caption ?? '');
15171517
}
15181518

1519-
public needToUpdateFirstCellClasses(): boolean {
1520-
const hasHidingColumnsQueue = !!this._adaptiveColumnsController
1521-
?.getHidingColumnsQueue()?.length;
1522-
1523-
return hasHidingColumnsQueue;
1524-
}
1525-
15261519
public updateFirstCellClasses(): void {
15271520
const rows = this._getRows();
15281521

0 commit comments

Comments
 (0)