Table.RecordModal component
<Table.RecordModal />
is a component for displaying an insert or update form for a database table. It works directly with the createTableRpc
settings and must always be used within a Table
component.
Fields
The fields
prop allows you to specify the form fields displayed in the insert and update forms.
By default, form fields are automatically generated based on your database schema and createTableRpc
settings. However, we recommend explicitly defining the fields
prop to exclude unnecessary fields and simplify future maintenance.
Here’s an example of the Table.RecordModal
component with defined fields:
Each field is an object with the following properties:
column
(string
): The name of the column in the table.label
(string
, optional): The label displayed to users for this field. Defaults to the column name if not provided.formField
(string
, optional): Specifies the type of form field to use for this columnrequired
(boolean
, optional): If true, this field must be filled out in form.
Basic field types
The type property defines the field type and supports additional properties depending on the type.
Below is a list of supported formFields types and their interfaces:
input
A single-line text input.
numberInput
A number-only input field.
textarea
A multi-line text input.
select
A searchable dropdown menu.
checkbox
A checkbox for boolean input.
datePicker
An inline date (datetime) picker.
timePicker
An inline time picker.
recordSelect
Select records from another table.
Requires a one-to-one relationship to be configured (see one-to-one linked).
Custom field
Use a custom React component for input.
Last updated