Table Component: Form Integration (Final-Form)
The table component can be integrated as an input control inside react-final-form to allow users to select one or multiple rows as part of a form submission.
Form Integration Properties
To enable form integration, pass the following properties to the <Table> component:
fieldType: Set to'radio'(for single selection) or'checkbox'(for multi-selection). This automatically renders selection buttons in a leading column on each row.fieldName: The path in form values where the selection should be stored (e.g.'attributes.security_groups').validate: An optional field validator (e.g.required).rowValidate: A callback function(row: RowType, formValues: any) => string | string[] | undefinedto validate individual rows based on overall form state. If it returns a string, that row is marked with an error.
Basic Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
Row Validation (rowValidate)
You can perform dynamic validation checks on specific rows based on other values in the form. If a row is invalid, the table will display a hover warning icon next to the selection checkbox/radio:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |