简体   繁体   English

如何防止在component.html上显示列总数?

[英]How to prevent column total Count from display on component.html?

I have field total count I need to prevent total Count from display on component.html我有字段总计数我需要防止总计数显示在组件上。html

I already do it but not working if you can tell me how to do that?我已经这样做了,但如果你能告诉我该怎么做,那我就不行了?

I display data dynamically on header column and body data with angular 7我使用 angular 7 在 header 列和正文数据上动态显示数据

I try using filter function below but not working我尝试使用下面的过滤器 function 但不起作用

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>

data object represent following data as any[]数据 object 将以下数据表示为 any[]

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

it solved by change my code above to它通过将我上面的代码更改为

this.headerCols = Object.keys(data[0]).filter(x => x !== 'totalCount');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM