Wj-combo default value selection

Posted by: kun.leeing on 10 June 2020, 11:59 pm EST

    • Post Options:
    • Link

    Posted 10 June 2020, 11:59 pm EST

    Hi Team,

    Just met an issue with wj-combobox

    <wj-combo-box 
                      [itemsSource]="Values"
                      [displayMemberPath]="'name'"
                      [selectedValuePath]="'value'"
                      [(ngModel)]="input.value"
                      >
        </wj-combo-box>
    

    The effect was that after loaded, the default item got selected, but the value did not put into the input.value. You have to manually select from dropdown and select, then the input.value get assigned.

    Does anyone know the reason about this?

    Thanks.

  • Posted 11 June 2020, 12:33 am EST

    Hi Kun,

    The ComboBox binding does not work properly with ngModel. You may use the selectedValue property to bind the value:

    <wj-combo-box 
                      [itemsSource]="Values"
                      [displayMemberPath]="'name'"
                      [selectedValuePath]="'value'"
                      [(selectedValue)]="input.value"
                      >
    </wj-combo-box>
    

    Regards,

    Ashwin

  • Posted 11 June 2020, 12:49 am EST

    That works perfect. Thanks, mate.

Need extra support?

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

Learn More

Forum Channels