Row Forms Technical Reference

Summary

  • Row Form Options provides functions for managing Row Forms
  • The Row Form Submitted Event fire when Row Forms are submitted
  • The Row Form API contains functions to display Row Forms programmatically

Row Form Options

The Row Form Options section of Adaptable Options is used to configure Row Forms.

PropertyTypeDescriptionDefault
autoHandlebooleanWhether AdapTable automatically updates AG Grid data model with created/edited/deleted rowstrue
disableInlineEditingbooleanPrevents direct editing in Grid cells even for editable columnsfalse
includeColumnInRowForm(rowFormColumnContext:RowFormColumnContext) => booleanIs given Column displayed in Row Formtrue
onRowFormSubmit(rowFormSubmittedInfo:RowFormSubmittedInfo<TData>) => voidEvent fired when a Row Form is submitted via a standard button provided by AdapTable; this is not invoked when custom form buttons are providedundefined
rowFormButtonsAdaptableButton<RowFormContext<TData>>[]Custom form buttons; if provided, need to handle form submission explicitly
rowFormDescriptionstring | ((context:RowFormTitleContext<TData>) => string)Custom form description providerundefined
rowFormField(context:RowFormFieldContext<TData>) => Partial<AdaptableFormField> | undefinedPer-column override for the auto-built .undefined
rowFormFieldLabel(context:RowFormFieldContext<TData>) => stringCustom form field label provider.undefined
rowFormTitlestring | ((context:RowFormTitleContext<TData>) => string)Custom form title provider'Create New Row'/'Edit Row'
setPrimaryKeyValue(context:SetPrimaryKeyValueContext<TData>) => anyFunction called when auto-handling 'create' or 'clone' Command Button; returned value should be valid for Primary Key columnundefined

Row Form Submitted Event

AdapTable fires the Row Form Submitted Event when an edit or create Row Form is submitted (or a delete ActionRowButton is clicked).

This allows developers to handle the form submission themselves, and provide any additional actions, validation or messages to backend services as required.

Hint

AdapTable handles all row manipulation directly, bypassing this event, if autoHandle is set to true in Row Form Options

RowFormSubmittedInfo

The RowFormSubmittedInfo object can be one of 3 types:

PropertyTypeDescription
formDataAdaptableFormDataData entered in the Form
rowNodeIRowNode<TData>Node being added
type'rowCreated'Specifies its a Created Row Form
adaptableContextanyCustom application Context provided in AdaptableOptions.adaptableContext
PropertyTypeDescription
formDataAdaptableFormDataData entered in the Form
rowNodeIRowNode<TData>Node being edited
type'rowEdited'Specifies its an Edited Row Form
adaptableContextanyCustom application Context provided in AdaptableOptions.adaptableContext
PropertyTypeDescription
rowNodeIRowNode<TData>Node being deleted
type'rowDeleted'Specifies its a Deleted Row Form
adaptableContextanyCustom application Context provided in AdaptableOptions.adaptableContext

Event Subscription

Subscribing to the Event is done the same way as with all Adaptable Events:

api.eventApi.on('RowFormSubmitted', (eventInfo: RowFormSubmittedInfo) => {
    // do something with the info
});

Row Form API

The Row Form API section of Adaptable API enables Row Forms to be displayed:

MethodReturnsDescription
displayCloneRowForm(primaryKey)Promise<void>Open create dialog for cloning an existing row
displayCreateRowForm()Promise<void>Open create dialog for a new row
displayDeleteRowForm(primaryKey)voidDeletes row from grid (with event fired) - note: no visible Row Form is displayed
displayEditRowForm(primaryKey)Promise<void>Open edit dialog for row with the given primary key value