我需要帮助才能使行仅在选中复选框时才启用。默认行应该被禁用,但是当复选框只被选中时,该行将被启用。这是我的代码的链接
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]
}))
})
})
}