Skip to content
Snippets Groups Projects
Commit ff6222db authored by François Grand's avatar François Grand Committed by David Dorchies
Browse files

fix: fish ladder: invalidate "calculate" button on domain invalid table values

refs #552
parent 4b967662
No related branches found
No related tags found
1 merge request!156Resolve "PAB: Lancement du calcul possible avec des champs vides"
......@@ -86,7 +86,8 @@
[title]="cellTitle(cell)">
<input matInput *ngIf="isNumberInput(cell)" step="0.00000000000001" type="number" required
[(ngModel)]="cell.model.singleValue" (input)="inputValueChanged($event, cell)">
[ngModel]="getCellValue(cell)" (ngModelChange)="setCellValue(cell,$event)"
(input)="inputValueChanged($event, cell)">
<mat-select #selectWidget *ngIf="isSelect(cell)" [value]="cell.modelValue"
(selectionChange)="loiDebitSelected($event, cell)">
......
......@@ -190,6 +190,9 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni
if (cell.uiValidity !== undefined) {
valid = valid && cell.uiValidity;
}
if (cell.modelValidity !== undefined) {
valid = valid && cell.modelValidity;
}
return ! valid;
}
......@@ -1439,6 +1442,19 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni
this.updateValidity();
}
public getCellValue(cell) {
return cell.model.singleValue;
}
public setCellValue(cell, event) {
try {
cell.model.singleValue = event
cell.modelValidity = undefined;
} catch (error) {
cell.modelValidity = false;
}
}
/**
* Computes the global Pab validity : validity of every cell of every row
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment