These are the columns I have:
this.columns = [
{ field: 'acronym', header: 'Acronym', sortable: true },
{ field: 'name', header: 'Name', sortable: true },
{ field: 'commonUserName', header: 'Credentials', sortable: true },
{ field: 'scope', header: 'Scope', sortable: true },
{ field: 'transversal', header: 'Transversal', sortable: true },
{ field: 'startDate', header: 'Start Date', sortable: true },
{ field: 'suspendDate', header: 'Suspend Date', sortable: true },
];
The HTML element p-dataTable
is structured as follows:
<div style="margin-bottom: 1.54em" *ngIf="!apps.error">
<p-dataTable #appsTable [value]="apps.content"...>
<p-column *ngFor="let col of cols" [field]="col.field" [header]="col.header" [sortable]="col.sortable">
</p-column>
</p-dataTable>
</div>
This configuration results in a table that looks like the following link:
https://i.sstatic.net/Daz3G.png
In the table, values are displayed as either "S" or "N". I want to display "Yes" when the value is "S" and "No" when the value is "N".
The data model consists of an array of objects with the following properties:
export interface ApplicationUser {
acronym: string;
code: string;
commonUserName: string;
description: string;
name: string;
transversal: string;
}
Do you have any suggestions on how to achieve this?