diff --git a/projects/swimlane/ngx-datatable/src/lib/components/datatable.component.ts b/projects/swimlane/ngx-datatable/src/lib/components/datatable.component.ts index 3cb20bed6..68908e978 100644 --- a/projects/swimlane/ngx-datatable/src/lib/components/datatable.component.ts +++ b/projects/swimlane/ngx-datatable/src/lib/components/datatable.component.ts @@ -189,13 +189,13 @@ export class DatatableComponent implements OnInit, DoCheck, AfterViewInit { * The minimum header height in pixels. * Pass a falsey for no header */ - @Input() headerHeight: number = 30; + @Input() headerHeight: number | 'auto' = 30; /** * The minimum footer height in pixels. * Pass falsey for no footer */ - @Input() footerHeight: number = 0; + @Input() footerHeight: number | 'auto' = 0; /** * If the table should use external paging @@ -851,8 +851,8 @@ export class DatatableComponent implements OnInit, DoCheck, AfterViewInit { if (this.scrollbarV) { let height = dims.height; - if (this.headerHeight) height = height - this.headerHeight; - if (this.footerHeight) height = height - this.footerHeight; + if (this.headerHeight) height = height - (this.headerHeight as number); + if (this.footerHeight) height = height - (this.footerHeight as number); this.bodyHeight = height; } diff --git a/projects/swimlane/ngx-datatable/src/lib/components/footer/footer.component.ts b/projects/swimlane/ngx-datatable/src/lib/components/footer/footer.component.ts index f742b6886..aa499ae05 100644 --- a/projects/swimlane/ngx-datatable/src/lib/components/footer/footer.component.ts +++ b/projects/swimlane/ngx-datatable/src/lib/components/footer/footer.component.ts @@ -45,7 +45,7 @@ import { DatatableFooterDirective } from './footer.directive'; changeDetection: ChangeDetectionStrategy.OnPush }) export class DataTableFooterComponent { - @Input() footerHeight: number; + @Input() footerHeight: number | 'auto'; @Input() rowCount: number; @Input() pageSize: number; @Input() offset: number;