[ ] bug report
[x] feature request
[ ] support request
Current behavior
Not able to close edit mode in p-table programmatically for instance by calling a method. Cell input mode can only be closed by pressing return or Esc.
Expected behavior
Would be nice to exit the cell edit mode by calling a method or firing some event.
Workaround:
you could use this function with a button in the edit template:
Tempalte
<p-table #dt ...
...
<p-cellEditor>
<ng-template pTemplate="input">
...
<button (click)="stopEdit($event)">OK</button>
</ng-template>
<ng-template pTemplate="output">
....
</ng-template>
</p-cellEditor>
...
Controller
...
@ViewChild('dt') dt: Table;
stopEdit(event) {
event.stopPropagation();
$(this.dt.editingCell).removeClass('ui-editing-cell');
this.dt.onEditComplete.emit({ field: null, data: null });
this.dt.editingCell = null;
}
...
Added closeCellEdit
Could we have thiss closeCellEditmethod in the new TreeTable aswell?
This needs to be reopened, it has regressed https://github.com/primefaces/primeng/issues/7055
I am unable to find this function
Most helpful comment
Added
closeCellEdit