mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-2765] Fix for the gallery view in datatable component (#3470)
* [ADF-2765] Fix for the gallery view in datatable component * [ADF-2765] Fixed lint errors * [ADF-2765] Changed maximum columns per row number * [ADF-2765] Removed trailing whitespace
This commit is contained in:
committed by
Eugenio Romano
parent
23403076a9
commit
edf82d9c05
@@ -161,6 +161,9 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
isSelectAllChecked: boolean = false;
|
||||
selection = new Array<DataRow>();
|
||||
|
||||
/** This array of fake rows fix the flex layout for the gallery view */
|
||||
fakeRows = [];
|
||||
|
||||
private clickObserver: Observer<DataRowEvent>;
|
||||
private click$: Observable<DataRowEvent>;
|
||||
|
||||
@@ -188,6 +191,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
})
|
||||
);
|
||||
}
|
||||
this.datatableLayoutFix();
|
||||
this.setTableSchema();
|
||||
}
|
||||
|
||||
@@ -220,6 +224,10 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
if (this.isPropertyChanged(changes['sorting'])) {
|
||||
this.setTableSorting(changes['sorting'].currentValue);
|
||||
}
|
||||
|
||||
if (this.isPropertyChanged(changes['display'])) {
|
||||
this.datatableLayoutFix();
|
||||
}
|
||||
}
|
||||
|
||||
ngDoCheck() {
|
||||
@@ -654,4 +662,16 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
this.dataRowsChanged = null;
|
||||
}
|
||||
}
|
||||
|
||||
datatableLayoutFix() {
|
||||
const maxGalleryRows = 25;
|
||||
|
||||
if (this.display === 'gallery') {
|
||||
for (let i = 0; i < maxGalleryRows; i++) {
|
||||
this.fakeRows.push('');
|
||||
}
|
||||
} else {
|
||||
this.fakeRows = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user