Skip to content

Commit 1871e49

Browse files
committed
fix(grid): Exclude border from rowHeight calc.
1 parent 88e7834 commit 1871e49

5 files changed

Lines changed: 15208 additions & 7 deletions

File tree

angular.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
"assets": [
2929
"src/favicon.ico",
3030
"src/assets",
31-
"src/web.config"
31+
"src/web.config",
32+
{
33+
"glob": "theme.css",
34+
"input": "src/app/grid-cellMerging",
35+
"output": "assets/grid-cellMerging"
36+
}
3237
],
3338
"styles": [
3439
"src/styles/styles.scss"

projects/igniteui-angular/grids/core/src/row.directive.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,8 @@ export class IgxRowDirective implements DoCheck, AfterViewInit, OnDestroy {
696696
}
697697
const isPinned = this.pinned && !this.disabled;
698698
const indexInData = this.grid.isRowPinningToTop && !isPinned ? this.index - this.grid.pinnedRecordsCount : this.index;
699-
if ((this.grid as any)._cdrRequests) {
700-
// recalc size if repaint is requested.
701-
this.grid.verticalScrollContainer.recalcUpdateSizes();
702-
}
703699
const size = this.grid.verticalScrollContainer.getSizeAt(indexInData);
704-
return size || this.grid.rowHeight;
700+
return (size - this.grid._borderSize) || this.grid.rowHeight;
705701
}
706702

707703
/**

src/app/grid-cellMerging/grid-cellMerging.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<h4 class="sample-title">Grid with cell merge</h4>
22

3+
<button (click)="toggleTheme()">{{ themeLoaded() ? 'Unload Theme CSS' : 'Load Theme CSS' }}</button>
4+
35
<div class="grid__wrapper">
46
<igx-input-group type="search" class="searchInput">
57
<igx-prefix>

src/app/grid-cellMerging/grid-cellMerging.component.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Component, ViewChild } from '@angular/core';
1+
import { Component, ViewChild, inject, signal } from '@angular/core';
2+
import { DOCUMENT } from '@angular/common';
23
import { FormsModule } from '@angular/forms';
34
import {
45
DefaultTreeGridMergeStrategy,
@@ -54,6 +55,8 @@ import { INVOICE_DATA } from '../shared/invoiceData';
5455
]
5556
})
5657
export class GridCellMergingComponent {
58+
private readonly document = inject(DOCUMENT);
59+
public themeLoaded = signal(false);
5760
public hierarchicalData = HIERARCHICAL_DATA.concat(HIERARCHICAL_DATA).concat(HIERARCHICAL_DATA);
5861
public treeData = HIERARCHICAL_SAMPLE_DATA;
5962
public treeGridMergeStrategy = new ByLevelTreeGridMergeStrategy();
@@ -74,6 +77,22 @@ export class GridCellMergingComponent {
7477
this.data = allData;
7578
}
7679

80+
public toggleTheme(): void {
81+
const id = 'grid-cell-merging-theme';
82+
const existing = this.document.getElementById(id);
83+
if (existing) {
84+
existing.remove();
85+
this.themeLoaded.set(false);
86+
} else {
87+
const link = this.document.createElement('link');
88+
link.rel = 'stylesheet';
89+
link.href = 'assets/grid-cellMerging/theme.css';
90+
link.id = id;
91+
this.document.head.appendChild(link);
92+
this.themeLoaded.set(true);
93+
}
94+
}
95+
7796
public toggleStrategy() {
7897
if (this.treeGridMergeStrategy instanceof ByLevelTreeGridMergeStrategy) {
7998
this.treeGridMergeStrategy = new DefaultTreeGridMergeStrategy();

0 commit comments

Comments
 (0)