Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Wont Pre-populate the selected igx-combo-box
posted

Hi,

Igx-combo won't prepopulate values coming from backend unless we put setTimeOut. Is there any other way around it? 

Without setTimeOut it will have the option pre-selected but won't show it in the box but upon expanding the list, it is there and selected too but not in the box itself.

HTML:

<div class="d-flex">
                    <div class="w-100">
                      <igx-combo
                        appComboItemWithTooltip
                        appOpenOnFocus
                        #eventNoCombo
                        [itemsMaxHeight]="250"
                        [data]="eventInfoList"
                        [displayKey]="'eventNumber'"
                        [valueKey]="'eventNumberId'"
                        formControlName="eventNumber"
                        (selectionChanging)="handleEventNumberselection($event)"
                        searchPlaceholder="Enter a {{
                          numberLabel | lowercase
                        }} number to search"
                      >
                      </igx-combo>
                    </div>
                  </div>

TS:

populateEventNumber(eventNo: string): void {
    
    if (eventNo) {
      const eventNumber: string[] = [];
      eventNumber.push(eventNo);
      setTimeout(() => {
        this.upsertEventForm.controls.eventNumber.patchValue(eventNumber);
      }, 350);
    }
  }


because of which this happens:



it loads after a while.

pacakge-json:

 "@igniteui/material-icons-extended": "^2.10.0",
    "@infragistics/igniteui-angular": "^12.2.3",
Please advice.