AdaptableForm

Defines a form which appears dynamically; used by Alerts, Export Custom Destinations and Dashboard Custom Toolbars.

TypeScript
export interface AdaptableForm<T extends BaseContext, TData extends

Properties

PropertyTypeDescriptionDefault
buttonsAdaptableButton<T>[]Buttons to include in the Form
descriptionstringAdditional information to appear in the Form
fields(AdaptableFormField|AdaptableFormField[] |AdaptableFormFieldGroup)[]Collection of Dynamic Fields and Field Groups to display.
layoutAdaptableFormLayoutHow the form's fields are arranged on screen.'rows'
onSubmit(formData: TData, context: T) => voidOptional form-level submit hook.
titlestringTitle to appear in the Form

Property Details

buttons

Buttons to include in the Form

TypeScript
buttons?: AdaptableButton<T>[];
Property Value

AdaptableButton<T>[]

description

Additional information to appear in the Form

TypeScript
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).

TypeScript
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.
TypeScript
layout?: AdaptableFormLayout;
Default Value

'rows'

Property Value

AdaptableFormLayout

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.

TypeScript
onSubmit?: (formData: TData, context: T) => void;
Property Value

(formData: TData, context: T) => void

title

Title to appear in the Form

TypeScript
title?: string;
Property Value

string