Using the incell editing for the primeng TurboTable, I am trying to execute a method by clicking on enter key. Here is the following code:
<td pEditableColumn>
<p-cellEditor>
<ng-template pTemplate="input">
<input type="text" [(ngModel)]="rowData.vin" (keyup.enter)="onKeyPress($event)">
</ng-template>
<ng-template pTemplate="output">
{{rowData.vin}}
</ng-template>
</p-cellEditor>
</td>
The problem is that the method onKeyPress
is not executed by clicking on the enterKey. So I've tried with keypress
as following:
<td pEditableColumn>
<p-cellEditor>
<ng-template pTemplate="input">
<input type="text" [(ngModel)]="rowData.vin" (keypress)="onKeyPress($event)">
</ng-template>
<ng-template pTemplate="output">
{{rowData.vin}}
</ng-template>
</p-cellEditor>
</td>
And what I've noticed is that the method onKeyPress
is executed by clicking on any button except the enter Key.