I use PrimeNG and its component p-table in my project. The table is editable. So you can click into a cell and edit the content directly. As in this example: https://www.primefaces.org/primeng/showcase/#/table/edit
I use these events to react to the editing:
private onEditInit(event) {
}
private onEditCancel(event) {
}
private onEditComplete(event) {
}
What I would like to achieve:
I have certain fields that must not be empty, i.e. they are mandatory. When the user finishes editing (by clicking somewhere else) onEditComplete is called. There I can check if he has entered a value and give him a warning message if not and it is mandatory.
Now I want to prevent the user from being able to finish editing at all, as long as no valid value has been entered. The focus should always remain in the cell. Can anyone give me a tip on how to achieve this?