【发布时间】:2021-08-03 08:34:29
【问题描述】:
在我的代码中,我有一个表,其中包含我需要其值的几列。我不希望用户看到这些列。我怎样才能使它们不可见? PS。我试过Visible = false,但我仍然能够看到整个专栏。
<ng-container matColumnDef="ProductCategory">
<th mat-header-cell *matHeaderCellDef> Kategori</th>
<td mat-cell *matCellDef="let row; let i = index">
<span *ngIf="EditIndex != i">{{row.ProductCategory?.CategoryName}}</span>
<mat-form-field *ngIf="EditIndex == i" class="w-100-p" >
<mat-select required name="ProductCategory" [(ngModel)]="row.ProductCategory"
(selectionChange)="productCategoryChange(row, $event.value.ProductCategoryId, i)">
<mat-option *ngFor="let prm of productCategories" [value]="prm" >
{{prm.CategoryName}}
</mat-option>
</mat-select>
</mat-form-field>
</td>
</ng-container>
【问题讨论】:
-
这能回答你的问题吗? angular2 material table hide column
标签: javascript html angular typescript