Home > Mobile >  Angular (primeng) when I load the page p-tableHeaderCheckbox I need to enable the checkbox but it is
Angular (primeng) when I load the page p-tableHeaderCheckbox I need to enable the checkbox but it is

Time:11-19

I tried, passing disabled attribute p-tableheadercheckbox to enable the checkbox.

<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>

CodePudding user response:

you probably have not assigned any value for p-table

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>
  • Related