How to change "wj-combo-box" selection on event raised by other formControl?

Posted by: sujay.adkar on 25 April 2018, 4:25 am EST

    • Post Options:
    • Link

    Posted 25 April 2018, 4:25 am EST

    Hi,

    I am using wj-combo-box.

    <wj-combo-box #calendar_comboboxValue class="forecast_dd wj_dd" id="datePicker"
                                                      [itemsSource]="upsellCollectionDropdown"
                                                      [selectedValuePath]="'key'"
                                                      [displayMemberPath]="'label'"
                                                      [isDisabled]="readOnlyData"
                                                      [selectedValue]="data.upsellKey"                                                                                                    
                                                      (isDroppedDownChanged)="calenderDropdownChanged(calendar_comboboxValue,data)">
                                        </wj-combo-box>
    

    Now I want to change item’s and also its value in combo box based on some other event raised by other control.

    Is there any way I can do that?

    Eagerly waiting for answers.

    Thanks in advance.

    Sujay Adkar

  • Posted 26 April 2018, 9:27 am EST

    Hi,

    If I understand correctly you would like to change ComboBox’s itemsSource and selectedItem on some events say button click.

    If that’s what you are looking for you may easily do that by accessing the ComboBox’s instance and directly assigning values.

    Please refer to following code snippet

    comboBox.itemsSource=newSource;
    
    comboBox.selectedItem=newItem;
    
    

    Here is the example of the same:- https://stackblitz.com/edit/angular-yjm8xg?file=app%2Fapp.component.ts

    Please let us know for any further query.

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels