Skip to content

Commit 326f2a2

Browse files
authored
Merge pull request #7498 from IgniteUI/mkirova/fix-6065
fix(igxGrid): Include custom footer, which is rendered next to pager,…
2 parents a663c50 + 4c60230 commit 326f2a2

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,9 +4656,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46564656
/**
46574657
* @hidden
46584658
*/
4659-
protected getPagingHeight(): number {
4659+
protected getPagingFooterHeight(): number {
46604660
let pagingHeight = 0;
4661-
if (this.paging && this.footer) {
4661+
if (this.footer) {
46624662
pagingHeight = this.footer.nativeElement.firstElementChild ?
46634663
this.footer.nativeElement.offsetHeight : 0;
46644664
}
@@ -4689,7 +4689,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
46894689
this.theadRow.nativeElement.offsetHeight;
46904690
const footerHeight = this.summariesHeight || this.tfoot.nativeElement.offsetHeight - this.tfoot.nativeElement.clientHeight;
46914691
const toolbarHeight = this.getToolbarHeight();
4692-
const pagingHeight = this.getPagingHeight();
4692+
const pagingHeight = this.getPagingFooterHeight();
46934693
const groupAreaHeight = this.getGroupAreaHeight();
46944694
const renderedHeight = toolbarHeight + actualTheadRow +
46954695
footerHeight + pagingHeight + groupAreaHeight +

projects/igniteui-angular/src/lib/grids/grid/grid.component.spec.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,10 @@ describe('IgxGrid Component Tests #grid', () => {
17421742
const footerContent = footer.textContent.trim();
17431743

17441744
expect(footerContent).toEqual('Custom content');
1745+
const grid = fix.componentInstance.grid;
1746+
1747+
const expectedHeight = parseInt(grid.height, 10) - grid.theadRow.nativeElement.offsetHeight - grid.scrollSize - 100;
1748+
expect(expectedHeight - grid.calcHeight).toBeLessThanOrEqual(1);
17451749
});
17461750
});
17471751

@@ -2129,15 +2133,19 @@ export class IgxGridColumnPercentageWidthComponent extends IgxGridDefaultRenderi
21292133
@Component({
21302134
template:
21312135
`<div>
2132-
<igx-grid #grid [data]="data" [displayDensity]="'compact'" [autoGenerate]="true"
2133-
[paging]="true" [perPage]="5">
2136+
<igx-grid #grid [data]="data" height='300px' [displayDensity]="'compact'" [autoGenerate]="true"
2137+
>
21342138
<igx-grid-footer>
2135-
Custom content
2139+
<div style='height:100px;'>
2140+
Custom content
2141+
</div>
21362142
</igx-grid-footer>
21372143
</igx-grid>
21382144
</div>`
21392145
})
21402146
export class IgxGridWithCustomFooterComponent extends IgxGridTestComponent {
2147+
public data = SampleTestData.foodProductData();
2148+
@ViewChild(IgxGridComponent, { static: true }) public grid: IgxGridComponent;
21412149
}
21422150
@Component({
21432151
template:

src/app/grid-column-moving/grid-column-moving.sample.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
[hasSummary]="false"
3737
[dataType]="c.type">
3838
</igx-column>
39+
<igx-grid-footer>
40+
<div style='height:200px;'>
41+
Test
42+
</div>
43+
</igx-grid-footer>
3944
</igx-grid>
4045
Drag mode: {{ grid1.selectionService.dragMode }}
4146
<div class="sample-buttons">

0 commit comments

Comments
 (0)