how to show or hide edit button based on column value in p-table

  angular, primefaces, primeng, primeng-datatable

how to show or hide edit button based when column srcSysName value = "ANO" in p-table

Here is the code

<ng-template pTemplate="body" let-ACC_LIST let-editing="editing" let-ri="rowIndex">
<tr [pEditableRow]="ACC_LIST">
                    <ng-template pTemplate="input">
                        <input pInputText type="text" [(ngModel)]="ACC_LIST.shortName">
                    <ng-template pTemplate="output">
            <td style="text-align:center">

                <button *ngIf="!editing"  pButton pRipple type="button" pInitEditableRow icon="pi pi-pencil"
                    (click)="onRowEditInit()" class="p-button-rounded p-button-text"></button>

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.