我可以在删除已在清晰度组合框中选择的实体之前执行操作吗?

问题描述 投票:0回答:0

我在表单中使用 Angular 应用程序的清晰度组合,我正在搜索一个实体并选择它,但在某些情况下,我从组合中删除该实体,但它可能与其他字段相关,所以我想显示一个弹出窗口,其中显示一条消息,通知用户该实体在删除之前可以在其他地方使用。是否有内置功能可以执行此操作?

component.ts中的代码

this.form = this.fb.group({ field1: [[]], field2: [null] })
以及

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>
    
angular typescript combobox vmware-clarity clarity
© www.soinside.com 2019 - 2024. All rights reserved.