Adding 'no records found' when table is empty
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / ei-coordinator / producers-list / producers-list.component.html
index 37b405a..cd79b6e 100644 (file)
@@ -63,7 +63,16 @@ limitations under the License.
       <mat-cell *matCellDef="let producer"> {{this.getProducerStatus(producer)}} </mat-cell>
     </ng-container>
 
-    <mat-header-row *matHeaderRowDef="['id', 'types', 'status']"></mat-header-row>
+    <ng-container matColumnDef="noRecordsFound">
+      <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
+    </ng-container>
+
+    <mat-header-row *matHeaderRowDef="['id', 'types', 'status']" [ngClass]="{'display-none': !this.hasProducers()}">
+    </mat-header-row>
     <mat-row *matRowDef="let row; columns: ['id', 'types', 'status'];"></mat-row>
+
+    <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': this.hasProducers()}">
+    </mat-footer-row>
+
   </mat-table>
 </div>