0

Here is my form:

  <form [formGroup]="form">
    <jqxComboBox [source]="source" formControlName="control">
    </jqxComboBox>
  </form>

I'm trying to update it from code behind like this:

this.form.get("control").setValue(value);

It works with jqxInput but not with jqxComboBox. Is there something I'm missing?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Plotva
  • 21
  • 2

1 Answers1

1

I was curious about this library so I did a short research and I guess you should use [selectedIndex] attribute for that

<form [formGroup]="form">
  <jqxComboBox [source]="source" formControlName="control" [selectedIndex]="index">
  </jqxComboBox>
</form>

And then in .ts file you can set it to index of the value in your source

public setValue(): void {
  this.index = this.source.findIndex(val => val === 'desiredValue');
}
mat.hudak
  • 2,803
  • 2
  • 24
  • 39