Ngx 数据表,用于显示一行条目



表图像 我想显示所有 trans 类型,但相关 id 只能出现一次。如何从前端实现这一点?

网页代码:

<ngx-datatable #tblCorrelations class="material fullscreen" [rows]="details" [columnMode]="'force'" [headerHeight]="'auto'" [footerHeight]="50" [rowHeight]="50" [limit]="15" [selected]="selected" [selectionType]="'single'">
<ngx-datatable-column name="Correlation ID" id="correlationid">
<ng-template let-row="row" ngx-datatable-cell-template>
{{row.correlationid}}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column name="Trans Type" id="transtype">
<ng-template let-row="row" ngx-datatable-cell-template>
{{row.transtype}}
</ng-template>
</ngx-datatable-column>
</ngx-datatable>

我的打字稿代码会是什么样子?请记住,相关 ID 不是反式类型 ID。这一切都是从数据库中提取的,而不是硬编码的

目前,显示重复相关 ID 并显示 trans 类型 我希望相关 id 只出现一次,并且它的所有反式类型

您的详细信息必须如下所示。(可以是接口(

export class/Interface InterfaceName {
correlationId: number;
transType: string[];
}

.ts文件中,将详细信息声明为:

public details: InterfaceName[];

最新更新