如何防止列总计数显示在 component.html?
How to prevent column total Count from display on component.html?
我有字段总计数 我需要防止总计数显示在 component.html
我已经做了,但是没有用,如果你能告诉我怎么做吗?
我在 header 列和 body 列动态显示数据 angular 7
我尝试使用下面的过滤器功能但不起作用
this._displayreport.GetReportDetailsPaging(this.searchData).subscribe((data: any[]) => {
this.reportdetailslist = data;
this.headerCols = Object.keys(data[0]);
this.contentBody=data.filter(item =>item != data[0].totalCount);
});
}
}
<thead>
<tr>
<th >
<ng-container *ngIf="coln != 'totalCount'">
{{coln}}
</ng-container>
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let rep of contentBody">
<td *ngFor="let coln of headerCols">
<span>
{{rep[coln]}}
</span>
</td>
</tr>
<tbody>
数据object表示以下数据为任意[]
companyName: "Innovasic, Inc."
done: "0"
notImpacted: "0"
notificationDate: "2009-11-12"
offilneURL: "https://source.z2data.com/2019/1/13/8/55/47/351/662203977/21527_SPCN.PDF"
onlineURL: "N/A"
pending: "3"
reportDate: "2020-05-07"
revisionID: "272299243"
teamName: "MFG"
totalCount: 79
通过将我上面的代码更改为
解决了
this.headerCols = Object.keys(data[0]).filter(x => x !== 'totalCount');
我有字段总计数 我需要防止总计数显示在 component.html
我已经做了,但是没有用,如果你能告诉我怎么做吗?
我在 header 列和 body 列动态显示数据 angular 7
我尝试使用下面的过滤器功能但不起作用
this._displayreport.GetReportDetailsPaging(this.searchData).subscribe((data: any[]) => {
this.reportdetailslist = data;
this.headerCols = Object.keys(data[0]);
this.contentBody=data.filter(item =>item != data[0].totalCount);
});
}
}
<thead>
<tr>
<th >
<ng-container *ngIf="coln != 'totalCount'">
{{coln}}
</ng-container>
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let rep of contentBody">
<td *ngFor="let coln of headerCols">
<span>
{{rep[coln]}}
</span>
</td>
</tr>
<tbody>
数据object表示以下数据为任意[]
companyName: "Innovasic, Inc."
done: "0"
notImpacted: "0"
notificationDate: "2009-11-12"
offilneURL: "https://source.z2data.com/2019/1/13/8/55/47/351/662203977/21527_SPCN.PDF"
onlineURL: "N/A"
pending: "3"
reportDate: "2020-05-07"
revisionID: "272299243"
teamName: "MFG"
totalCount: 79
通过将我上面的代码更改为
解决了this.headerCols = Object.keys(data[0]).filter(x => x !== 'totalCount');