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(pivot): fixed row height to scale with headers #14811

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3243,6 +3243,9 @@
max-height: 100%;
}
}
%igx-grid_tr-pivot-row-area {
padding-bottom: 0;
}
}

%grid-thead--pivot {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</ng-template>
</ng-template>
<ng-template #record_template let-rowIndex="index" let-rowData>
<igx-pivot-row [style.height.px]="renderedRowHeight" [gridID]="id" [index]="rowIndex" [data]="rowData"
<igx-pivot-row [gridID]="id" [index]="rowIndex" [data]="rowData"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger" #row>
</igx-pivot-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,43 @@ describe('IgxPivotGrid #pivotGrid', () => {
expect(pivotGrid.columns.length).toBe(3);
});

it('should calculate row headers according to grid size', async() => {
const pivotGrid = fixture.componentInstance.pivotGrid;
const rowHeightSmall = 32;
const rowHeightMedium = 40;
const rowHeightLarge = 50;

pivotGrid.superCompactMode = false;
setElementSize(pivotGrid.nativeElement, Size.Large);

await wait(100);
fixture.detectChanges();

expect(pivotGrid.gridSize).toBe(Size.Large);
const dimensionContents = fixture.debugElement.queryAll(By.css('.igx-grid__tbody-pivot-dimension'));
let rowHeaders = dimensionContents[0].queryAll(By.directive(IgxPivotRowDimensionHeaderGroupComponent));
let rowHeader = rowHeaders[0].queryAll(By.directive(IgxPivotRowDimensionHeaderComponent));
expect(rowHeader[0].nativeElement.offsetHeight).toBe(rowHeightLarge);

setElementSize(pivotGrid.nativeElement, Size.Small);
await wait(100);
fixture.detectChanges();

expect(pivotGrid.gridSize).toBe(Size.Small);
rowHeaders = dimensionContents[0].queryAll(By.directive(IgxPivotRowDimensionHeaderGroupComponent));
rowHeader = rowHeaders[0].queryAll(By.directive(IgxPivotRowDimensionHeaderComponent));
expect(rowHeader[0].nativeElement.offsetHeight).toBe(rowHeightSmall);

setElementSize(pivotGrid.nativeElement, Size.Medium);
await wait(100);
fixture.detectChanges();

expect(pivotGrid.gridSize).toBe(Size.Medium);
rowHeaders = dimensionContents[0].queryAll(By.directive(IgxPivotRowDimensionHeaderGroupComponent));
rowHeader = rowHeaders[0].queryAll(By.directive(IgxPivotRowDimensionHeaderComponent));
expect(rowHeader[0].nativeElement.offsetHeight).toBe(rowHeightMedium);
});


describe('IgxPivotGrid Features #pivotGrid', () => {
it('should show excel style filtering via dimension chip.', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
</igx-grid-header-group>
</ng-container>
</ng-container>
<div class="igx-grid-thead--virtualizationWrapper" [style.max-height.px]='maxContainerHeight' (click)="grid.navigation.focusOutRowHeader($event)">
<div class="igx-grid-thead--virtualizationWrapper" [style.max-height.px]='maxContainerHeight' (click)="grid.navigation.focusOutRowHeader($event)">
<div class="igx-grid-thead__group igx-grid-thead--virtualizationContainer" [style.height.px]='totalDepth > 1 ? grid.rowHeight : undefined' *ngFor='let dimLevelColumns of columnDimensionsByLevel; let i = index' [style.width.px]='grid.unpinnedWidth'>
<ng-template igxGridFor #headerVirtualContainer let-column
[igxGridForOf]="dimLevelColumns" [igxGridForOfUniqueSizeCache] = 'true' [igxForScrollContainer]="grid.parentVirtDir"
Expand Down
Loading