0

I have a PrimeNG table

<p-table [value]="products" dataKey="name" (onEditInit)="onEditInit($event)"   (onEditComplete)="onEditComplete($event)"   (onEditCancel)="onEditCancel($event)"
>

and I am using the CellEdiding Function

<tr>
      <td
        [pEditableColumn]="product.name"
        [pEditableColumnField]="product.comment"
        [pEditableColumnRowIndex]="product.id"
      >

I can exit from the editing mode by typing "enter" or "escape" on the keyboard. Is there any way to do it by clicking on a button ?

Exemple available here

Iznogood1
  • 152
  • 2
  • 11

1 Answers1

0

See : Switch p-table cell programmatically to edit mode in Primeng

and use :

setTimeout(() => {
     this.editableColumn.closeEditingCell();
}, 0);
user2452092
  • 142
  • 6