Posted 11 September 2017, 11:43 pm EST
We are using Wijimo autocomplete with Angular 4
We have one staff ID autocomplete complete control, the users can type the staffID which is not in the [itemsSource] list.
When the user type the StaffID which is not in the [itemsSource] list, the dropdown image becomes disabled.
We have another requirement, whenever the user clicks on the dropdown symbol of autocomplete, the autocomplete should show the all the elements in [itemSource] list.
<wj-auto-complete id=“staffidobj” name=“staffidobj” class=“multi_drop popup_input” #staffidobj
autocomplete=“off”
(keyup)=“autoCompleteStaffID($event)”
formControlName=“StaffID”
[displayMemberPath]=“‘label’”
[selectedValuePath]=“‘label’”
[isEditable]=“true”
[minLength]=“1”
[isReadOnly]="deleteUpsellFlag" (isDroppedDownChanged)="staffIDValid(addNewUpsellForm.value)" [itemsSource]="autoCompleteStaffIDList" (lostFocus)="staffid_lostFocus(staffidobj.text)" uc-combo-box [ngClass]="{'editfield_color':staffIDRevokeFlag==true}"> </wj-auto-complete>
angular functions
staffid_lostFocus(fieldName)
{
if (this.action.upsellEdit.event != 1) {
if (fieldName.trim() == ‘’) {
this.staffIDFlag = false;
}
else {
this.staffIDFlag = true;
}
}
this.StaffID.setValue(fieldName);
}
staffIDValid(addUpsell) {
if (addUpsell.StaffID == “” || addUpsell.StaffID == null) {
} else {
if (this.editUpsellFlag == true || this.action.upsellEdit.event == ‘4’) {
if (addUpsell.StaffID != this.action.upsellEdit.staffID) {
this.staffIDRevokeFlag = true;
} else {
this.staffIDRevokeFlag = false;
}
}
this.staffIDFlag = true;
}
}
