这是我的表格:
<form [formGroup]="form">
<jqxComboBox [source]="source" formControlName="control">
</jqxComboBox>
</form>我正在尝试从代码后台更新它,如下所示:
this.form.get("control").setValue(value);它可以与jqxInput一起工作,但不能与jqxComboBox一起工作。我是不是漏掉了什么?
发布于 2019-08-07 14:02:02
我对这个库很好奇,所以我做了一个简短的研究,我想你应该使用[selectedIndex]属性
<form [formGroup]="form">
<jqxComboBox [source]="source" formControlName="control" [selectedIndex]="index">
</jqxComboBox>
</form>然后在.ts文件中,您可以将其设置为源代码中的值的索引
public setValue(): void {
this.index = this.source.findIndex(val => val === 'desiredValue');
}https://stackoverflow.com/questions/57381060
复制相似问题