我需要帮助使行仅在选中复选框时才启用。应该禁用默认行,但是仅选中复选框时,将启用该行。这是我的代码的链接
patchValues() {
let rows = this.myForm.get('rows') as FormArray;
this.orders.forEach(material => {
material.materials.forEach(x => {
rows.push(this.fb.group({
checkbox_value: [null],
material_id: new FormControl({value: x.id, disabled: true}, Validators.required),
material_name: x.name,
quantity: [null, Validators.required]
}))
})
})
}
Run Code Online (Sandbox Code Playgroud)