我目前有一个带有内联编辑的 html 表,它使用普通的 Angular Reactive Forms,包括很多验证规则:
\n\nvar formArray = new FormArray(this.items.map(createItemFormGroup));\n\ncreateItemFormGroup(item){\n return new FormGroup({\n prop1: new FormControl(item.prop1, [Validators.required, Validators.min(1)])\n prop2:...\n })\n}\nRun Code Online (Sandbox Code Playgroud)\n\n有没有关于如何将 ag-grid 与 Angular 验证集成的示例?要求是,我需要突出显示无效的单元格值。我不一定需要使用 FormGroup\xe2\x80\xa6
\n\n我可能会使用完整的行编辑,所以一种方法是仅为正在编辑的行创建 FormGroup......
\n有没有ag-grid比用更好的方法来验证行valueSetter?
我可以通过它来完成验证,但是不确定是否有更好的方法。
https://www.ag-grid.com/javascript-grid-value-setters/#properties-for-setters-and-parsers
我要验证行中的两个字段。DateFrom和DateUntil(不允许为null,DateFrom必须小于DateUntil)。