I am using clarity combobx with my Angular app in a form, I am searching for an entity and selecting it, but in some cases, I delete this entity from the combobx but it maybe could be related to other fields, so I want to show a pop up that shows a message to inform the user that this entity could be used in somewhere else before deleting it. Is there a built-in functionality to do this?
code in component.ts:
this.form = this.fb.group({
field1: [[]],
field2: [null]
})
and the code in component.html:
<clr-combobox-container>
<label>Field 1</label>
<clr-combobox formControlName="field1"
name="field1Select"
appComboboxResetSearchtext
[clrLoading]="field1ComboboxHelper.isLoading"
(clrInputChange)="field1ComboboxHelper.triggerSearch($event)"
(clrOpenChange)="$event ? field1ComboboxHelper.triggerSearch() : null"
clrMulti="true">
<ng-container *clrOptionSelected="let selected">{{selected.name}}
</ng-container>
<clr-options>
<clr-option *clrOptionItems="let entity of field1ComboboxHelper.entities | async; field:'name'" [clrValue]="entity">
{{entity.name}}
</clr-option>
</clr-options>
</clr-combobox>
</clr-combobox-container>
<clr-select-container *ngIf="this.form.get('field1').value.length>0">
<label>Field 2</label>
<select clrSelect name="field2"
[(ngModel)]="selectedField2"
(ngModelChange)="onField2Selected()">
<option *ngFor="let field of this.form.get('field1').value" [ngValue]="field">
{{field.name | multilanguage | async}}
</option>
<option [ngValue]="null">-</option>
</select>
</clr-select-container>