Skip to content
Snippets Groups Projects
Commit f7a9fecf authored by Angapay Divin's avatar Angapay Divin
Browse files

make selector desableb in for checkbox search type when the user validate a criteria

parent c96e1d62
No related branches found
No related tags found
2 merge requests!72Develop,!38Resolve "Réorganisation criterion (null, not null)"
......@@ -2,7 +2,7 @@
<div class="row form-group">
<div class="col-md-3 col-sm-auto pr-sm-1 mb-1 mb-lg-0">
<select class="custom-select" (change)="labelOnChange()" formControlName="label">
<option [value]="'In'">In</option>
<option [value]="">In</option>
<option [value]="'nl'">Null</option>
<option [value]="'nnl'">Not Null</option>
</select>
......
......@@ -26,7 +26,6 @@ export class CheckboxComponent extends AbstractSearchTypeComponent {
formControls.push(new FormControl());
}
this.form.addControl('checkboxes', new FormArray(formControls));
}
setCriterion(criterion: Criterion) {
......@@ -40,8 +39,9 @@ export class CheckboxComponent extends AbstractSearchTypeComponent {
}
}else{
this.form.controls.label.setValue('In');
}
this.labelOnChange();
}
/**
......@@ -87,11 +87,10 @@ export class CheckboxComponent extends AbstractSearchTypeComponent {
labelOnChange() {
if (this.form.controls.label.value === 'nl' || this.form.controls.label.value === 'nnl') {
this.nullOrNotNull = this.form.controls.label.value;
this.getCheckboxes().controls.map((value, index) => {
value.disable();
})
this.nullOrNotNull = this.form.controls.label.value;
} else {
this.nullOrNotNull = '';
......
<form [formGroup]="form" novalidate>
<div class="row form-group">
<div class="col-md-3 col-sm-auto pr-sm-1 mb-1 mb-lg-0">
<select class="custom-select" (change)="labelOnChange()" formControlName="label">
<select class="custom-select" (change)="labelOnChange()" formControlName="label">
<option [value]="'='">=</option>
<option [value]="'nl'">Null</option>
<option [value]="'nnl'">Not Null</option>
......@@ -9,7 +9,8 @@
</div>
<div class="w-100 d-block d-sm-none"></div>
<div class="col pl-sm-1">
<textarea class="form-control" rows="3" [placeholder]="getPlaceholder()" formControlName="list" autocomplete="off"></textarea>
<textarea class="form-control" rows="3" [placeholder]="getPlaceholder()" formControlName="list"
autocomplete="off"></textarea>
</div>
</div>
</form>
</form>
\ No newline at end of file
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