【问题标题】:Angular (primeng) when I load the page p-tableHeaderCheckbox I need to enable the checkbox but it is disabledAngular (primeng) 当我加载页面 p-tableHeaderCheckbox 我需要启用复选框但它被禁用
【发布时间】:2022-11-19 12:46:45
【问题描述】:
我试过了,传递了 disabled 属性p-tableheadercheckbox启用复选框。
<p-tableHeaderCheckbox [disabled]="false"></p-tableHeaderCheckbox>
<ng-template pTemplate="header">
<tr>
<th style="width: 3rem">
<p-tableHeaderCheckbox [disabled]="false"></p-tableHeaderCheckbox>
</th>
<th>Recharge Amount ({{ rupeeSymbol }})</th>
<th>Tag Account</th>
<th>Plate No.</th>
<th>Tag Serial No.</th>
<th>Vehicle Class</th>
<th>Minimum Threshold ({{ rupeeSymbol }})</th>
<th>Current Balance ({{ rupeeSymbol }})</th>
</tr>
</ng-template>
【问题讨论】:
标签:
angular
typescript
primeng
【解决方案1】:
您可能没有为 p 表分配任何值
tableValue = [
{ rechargeAmt: 123, tagAccount: 2012, plateNo: 123, tagSerialNo: "asdasd", ...},
];
<p-table [value]="tableValue">
<ng-template pTemplate="header">
<tr>
<th style="width: 3rem">
<p-tableHeaderCheckbox [disabled]="false"></p-tableHeaderCheckbox>
</th>
<th>Recharge Amount ({{ rupeeSymbol }})</th>
<th>Tag Account</th>
<th>Plate No.</th>
<th>Tag Serial No.</th>
<th>Vehicle Class</th>
<th>Minimum Threshold ({{ rupeeSymbol }})</th>
<th>Current Balance ({{ rupeeSymbol }})</th>
</tr>
</ng-template>
</p-table>