我有datatable
个编辑。当我单击“编辑”按钮时,将弹出一个弹出窗口,其中填充了formcontrol
以外的所有p-autocomplete
值。
下面是代码。
HTML :(以下html代码用于p-autocomplete
(PrimeNG))
[suggestions]="cities" [forceSelection]="true" formControlName="city" field="value" (completeMethod)="selectedcity($event)" [minLength]="3"
脚本:
onRowEdit(c: UserAddr) {
this.valid = false;
this.userAddrForm.setValue({
mgAddrId: c.mgAddrId,
lineA: c.lineA,
lineB: c.mdPostalCd.area,
lineC: c.mdPostalCd.suburb,
city: c.mdPostalCd.city,
province: c.province,
zipcode: c.mdPostalCd.zipCd
});
this.index = this.addresses.indexOf(c);
this.displayDialog = true;
}
谢谢