In my component, I have a p-table with input fields. I want to achieve the functionality where, after filling in the input and sending the data to the database via REST, pressing 'tab' will shift the focus to the next input field similar to Excel.
Should I implement this using directives?
<ng-template pTemplate="body" class="tableBody" let-rowData let-x="rowIndex" let-columns="columns">
<tr [pSelectableRow]="rowData" [ngClass]="rowData.editable != 'true' ? 'cell-color-gray2' : null" [hidden]="!showSubTotal(rowData)">
<td *ngFor="let col of columns; let i = index" class="ui-resizable-column" [pEditableColumn]="rowData[col.field]" [pEditableColumnField]="rowData[col.field]">
<p-cellEditor>
<ng-template pTemplate="input">
<div *ngIf="menuLabels.state=='editable' && rowData.editable=='true'">
<div *ngIf="col.field=='customEffort'" class="tableColumnRight">
<input #inputs type="text" ngDefaultControl [(ngModel)]="this.rowData.effort" autoResize="autoResize"
(focusout)="workaroundUpdateDataEffort({ data: rowData, costCenterNr: col.header.split(' ')[0], columns: columns }, x, i)"
(keydown.tab)="workaroundUpdateDataEffort({ data: rowData, costCenterNr: col.header.split(' ')[0], columns: columns }, x, i)"
(keydown.enter)="workaroundUpdateDataEffort({ data: rowData, costCenterNr: col.header.split(' ')[0] })"
(keydown.esc)="workaroundCatchEsc({ data: rowData })">
</div>