After updating the data-array (FileDto), I am unable to see any changes reflected in the Datatable.
I have tested outputting the data using ngFor, and it works perfectly fine.
Here is the HTML code:
<ngx-datatable
class="material striped"
[rows]="fileDtos"
[columnMode]="'force'"
[rowHeight]="'auto'"
[messages]="gridMessages"
>
<ngx-datatable-column name="name" >
<ng-template let-column="column" ngx-datatable-header-template>
<strong>{{ 'FILES.NAME' | translate}}</strong>
</ng-template>
</ngx-datatable-column>
</ngx-datatable>
Typescript file:
loadFiles(): void {
this._fileService.getFiles(this.auftragId, false).subscribe(files => {
this.fileDtos = files;
this._fileService.getExcelFiles(this.auftragId).subscribe(filesexcel => {
if ( filesexcel) {
filesexcel.forEach(item => {
this.fileDtos.push(item);
});
}
});
});
}
Data object:
export class FileDto {
name: string;
iconUrl: string;
extension: string;
created: Date | string;
modified: Date | string;
}
Despite not receiving any error messages, the Datatable does not display any data. Any insights on why this might be happening?
Sample data:
{name: "Filename1.xlsm", iconUrl: null, extension: "", created: "2019-03-12T13:37:25.973", modified: "0001-01-01T00:00:00"}
{name: "Filename2.xlsm", iconUrl: null, extension: "", created: "2019-03-12T12:13:53.847", modified: "0001-01-01T00:00:00"}
{name: "Filename3.xlsm", iconUrl: null, extension: "", created: "2019-03-12T13:37:25.973", modified: "0001-01-01T00:00:00"}