fix empty datatable hiding the header (#3003)

This commit is contained in:
Eugenio Romano
2018-02-26 14:57:27 +00:00
committed by GitHub
parent e127149a2e
commit 4e05e78846
6 changed files with 28 additions and 21 deletions

View File

@@ -535,6 +535,14 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck
});
}
isEmpty() {
return this.data.getRows().length === 0;
}
isHeaderVisible() {
return this.showHeader && !this.loading && !this.isEmpty();
}
private emitRowSelectionEvent(name: string, row: DataRow) {
const domEvent = new CustomEvent(name, {
detail: {