Configuring Row Forms

View as Markdown

Summary

  • Row Forms are types of AdapTable Form and are highly configurable

AdapTable Form

The Row Form displayed by AdapTable is a specialised Adaptable Form which renders one row for each data element in the Data Source

Note

AdapTable will provide the appropriate edit input for the Column's Data Type (if the cell / column is editable)

Included Columns

By default AdapTable will include every Column in the Grid in the Row Form.

This can be configured by using the includeColumnInRowForm property in Row Form Options which determines inclusion a case by case basis.

includeColumnInRowForm

Default: true (all columns)
(context) => boolean
Whether a Column should be included in the Row Form

Form Title

rowFormTitle

Default: 'Create New Row' / 'Edit Row'

string | ((context: RowFormTitleContext) => string)

Title shown at the top of the Row Form

Form Description

rowFormDescription

string | ((context: RowFormTitleContext) => string)

Description shown below the Row Form Title

Default Buttons

By default AdapTable will display 2 Buttons at the bottom of the Form:

  • Save - automatically saves the Row (for Edit buttons) or creates a new Row (for Create & Clone buttons)

Caution

  • AdapTable will only automatically perform these actions if autoHandle is set to true in Row Form Options
  • Cancel - closes the Form with no changes made

Custom Buttons

rowFormButtons

AdaptableButton[]

Replace the default Save and Cancel Buttons
Row Form Config
Fork
  • This demo illustrates how to configure the Edit Row Form. In rowFormOptions we provide many properties including:
    • includeColumnInRowForm - we exclude the Actions Column (that displays the Add Button) and the Id Column from the displayed form
    • rowFormTitle - we provide a custom Title based on the Row being edited
    • rowFormDescription - we provide a custom Description that appears below the Form Title
    • rowFormFieldLabel - we change the text of the Label for Language Column
    • rowFormButtons - we provide 2 Custom Buttons that display at the end of the Form and have custom Styles;
      • Cancel - displays an Alert when clicked
      • Save - has a custom Label which references the Row, and updates the Grid when clicked (button is disabled where Issue Change is negative)
    • Note: we set autoHandle to false since we are providing the functionality to update the Grid
Loading demo…

Disabling In-line Editing

AdapTable can be configured so that the only editing allowed is through the Row Form, i.e. not directly inline in the cell itself.

This is achieved by setting the disableInlineEditing property in Row Form Options to true.

disableInlineEditing

Default: false
boolean
Prevents Inline Editing (so that Row Forms can be used)

Caution

Even Columns which have been directly set to be editable in Grid Options will be readonly (for inline editing)

Setting Primary Key Value

Every AdapTable instance requires a Primary Key column to be provided.

This is a column which guarantees to hold unique values.

This means that when adding a new row to the Data Set via a Row Form - either Create or Clone - it is possible that the run-time user might not know what value to provide to the Primary Key Column.

For this reason, AdapTable provides the setPrimaryKeyValue property in Row Form Options which can return a Primary Key value for the row automatically.

setPrimaryKeyValue

Returns a Primary Key value when using Create Row Form