AdaptableForm
Defines a form which appears dynamically; used by Alerts, Export Custom Destinations and Dashboard Custom Toolbars.
export interface AdaptableForm<T extends BaseContext, TData extendsProperties
| Property | Type | Description | Default |
|---|---|---|---|
| buttons | AdaptableButton<T>[] | Buttons to include in the Form | |
| description | string | Additional information to appear in the Form | |
| fields | (AdaptableFormField|AdaptableFormField[] |AdaptableFormFieldGroup)[] | Collection of Dynamic Fields and Field Groups to display. | |
| layout | AdaptableFormLayout | How the form's fields are arranged on screen. | 'rows' |
| onSubmit | (formData: TData, context: T) => void | Optional form-level submit hook. | |
| title | string | Title to appear in the Form |
Property Details
buttons
Buttons to include in the Form
buttons?: AdaptableButton<T>[];Property Value
AdaptableButton<T>[]
description
Additional information to appear in the Form
description?: string;Property Value
string
fields
Collection of Dynamic Fields and Field Groups to display.
Items can be: - a single (rendered on its own row in the default rows layout, or as one cell in the inline layout), - an array of (rendered side-by-side on the same row in the rows layout), or - an (a labelled section that visually groups related fields).
fields?: (AdaptableFormField | AdaptableFormField[] | AdaptableFormFieldGroup)[];Property Value
(AdaptableFormField|AdaptableFormField[] |AdaptableFormFieldGroup)[]
layout
How the form's fields are arranged on screen.
rows(default): each field on its own row, label on the left and input on the right. Suitable for popups / wizards. -inline: fields are placed side-by-side on a single horizontal line, with the label rendered immediately before its input. Designed for compact contexts such as Dashboard Custom Toolbars where vertical real-estate is scarce.
layout?: AdaptableFormLayout;Default Value
'rows'
Property Value
onSubmit
Optional form-level submit hook.
Fired when the user presses Enter while focus is inside any field input AND the form is currently valid. The full formData is passed through, typed as TData if you've supplied a custom shape.
Use this as an ergonomic shortcut to avoid wiring an explicit "Submit" button - or in addition to one, so power users can press Enter to commit. If the form is invalid the hook is not invoked.
onSubmit?: (formData: TData, context: T) => void;Property Value
(formData: TData, context: T) => void
title
Title to appear in the Form
title?: string;Property Value
string