Configuring Row Forms
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 apppropriate 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: nullBooleanDefault Buttons
By default AdapTable will display 2 Buttons at the bottom of the Form:
-
Save - automatically saves the Row (for
Editbuttons) or creates a new Row (forCreate&Clonebuttons)Caution
- AdapTable will only automatically peform these actions if
autoHandleis set to true in Row Form Options - If false, developers need to handle, as required, the the Row Form Submitted Event which AdapTable fires
- AdapTable will only automatically peform these actions if
-
Cancel - closes the Form with no changes made
Custom Buttons
Developers are able to provide their own set of buttons in place of the ones provided by AdapTable.
This is done through the formButtons property in the rowFormOptions section of Row Form Options.
Hint
This section allows you to configure the Row Form in multiple ways, not just the Buttons (see below)
Each button is of type Adaptable Button which is used in multiple places in the AdapTable UI, and contains many properties including label, visibility, style and onClick.
As soon as any button is clicked, the Form automatically closes.
Caution
- If replacing the default Save button, it is the developer's responsibility to ensure that any changes are persisted by wiring up the
onClickproperty of the Button - AdapTable will not not invoike the
onFormSubmitcallback, nor fire the Row Form Submitted Event
- This demo illustrates how to configure the Edit Row Form. In
rowFormOptionswe provide many properties including:includeColumnInRowForm- we exclude theActionsColumn (that displays theAddButton) and theIdColumn from the displayed formrowFormTitle- we provide a custom Title based on the Row being editedrowformDescription- we provide a custom Description that appears below the Form TitlerowformFieldLabel- we change the text of the Label forLanguageColumnrowformButtons- we provide 2 Custom Buttons that display at the end of the Form and have custom Styles;Cancel- displays an Alert when clickedSave- has a custom Label which references the Row, and updates the Grid when clicked (button is disalbed where Issue Change is negative)
- Note: we set
autoHandleto false since we are providing the functionality to update the Grid
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: falsebooleanCaution
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.