Commit 1a670a51 authored by LAVENIER's avatar LAVENIER
Browse files

Release v0.13.12

[fix] Table: When deleting rows, should cancel invalid rows, to make sure saveBeforeDelete can be executed
parent 045f4f35
{
"name": "@sumaris-net/ngx-components",
"description": "SUMARiS Angular components",
"version": "0.13.11",
"version": "0.13.12",
"author": "contact@e-is.pro",
"license": "AGPL-3.0",
"readmeFilename": "README.md",
......
......@@ -937,11 +937,17 @@ export abstract class AppTable<
const canDelete = await this.canDeleteRows(rows, opts);
if (!canDelete) return 0; // Cannot delete
// If data need to be saved first: do it
const saved = await this.saveBeforeAction('delete');
if (!saved) {
// Stop if save cancelled or save failed
return;
if (this.saveBeforeDelete) {
// Cancel invalid rows (because of save() will failed if there is invalid rows)
rows.filter(row => !row.validator?.valid)
.forEach(row => row.cancelOrDelete());
// If data need to be saved first: do it
const saved = await this.saveBeforeAction('delete');
if (!saved) {
// Stop if save cancelled or save failed
return;
}
}
if (this.debug) console.debug('[table] Delete selection...');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment