#601 support for fallback thumbnails

This commit is contained in:
Denys Vuika
2016-08-25 12:49:36 +01:00
parent bec481e81e
commit 2d8d31aed4
5 changed files with 41 additions and 2 deletions

View File

@@ -63,6 +63,9 @@ export class DataTableComponent implements OnInit, AfterViewChecked {
@Input()
actions: boolean = false;
@Input()
fallbackThumbnail: string;
@Output()
rowClick: EventEmitter<DataRowEvent> = new EventEmitter<DataRowEvent>();
@@ -155,6 +158,12 @@ export class DataTableComponent implements OnInit, AfterViewChecked {
}
}
onImageLoadingError(event: Event) {
if (event && this.fallbackThumbnail) {
event.srcElement.src = this.fallbackThumbnail;
}
}
isIconValue(row: DataRow, col: DataColumn) {
if (row && col) {
let value = row.getValue(col.key);