igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Not able to set value of combo in reactive form

Open wnvko opened this issue 2 years ago • 1 comments

Description

I have a combo in reactive form. In the form builder I am setting initial value for the combo related form control.

  • igniteui-angular version: 16.1.0
  • browser: all

Steps to reproduce

Check this Stackblitz sample - https://stackblitz.com/edit/rucvus?file=src%2Fapp%2Fhow-to%2Freactive-forms%2Freactive-forms.component.ts,package.json.

Result

Combo has no initial values selected.

Expected result

Combo should have initial values selected.

wnvko avatar Nov 03 '23 14:11 wnvko

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Jan 03 '24 00:01 github-actions[bot]

@wnvko @dkamburov I'm not that familiar with the combo, but looking at the docs: https://www.infragistics.com/products/ignite-ui-angular/angular/components/combo#two-way-binding It seems that the bindings expect just an array of the simple value associated with the valueKey in the data, so instead of the whole complex object:

 genres: [[{ type: 'Action' }, { type: 'Crime' }]],

Maybe it should be just the string value:

      genres: [['Action', 'Crime']],

And in that case it gets sets as expected: https://stackblitz.com/edit/rucvus-qegyvi Let me know if that solves your issue or if I'm missing something.

MayaKirova avatar Feb 27 '24 10:02 MayaKirova

Sounds reasonable to me. @wnvko does that work for you? Please re-open it if we are missing something.

dkamburov avatar Mar 25 '24 08:03 dkamburov