【问题标题】: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>
    

    【讨论】:

      猜你喜欢
      • 2016-10-03
      • 1970-01-01
      • 2014-12-31
      • 1970-01-01
      • 2018-11-15
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      相关资源
      最近更新 更多