Layout Technical Reference

View as Markdown

Layout State

LayoutState

Layout section of Adaptable State, including Initial State.

Layouts is a non-empty list of table and pivot layouts. CurrentLayout is the Name loaded at startup; when omitted, the first layout is used. LayoutExtensions is how objects from other modules (Format Columns, Styled Columns, and so on) apply only in named layouts.

Extends

BaseState

Layout to be loaded when AdapTable starts (using Name property in Layout); if not provided the first Layout is used

Objects from other Modules (e.g. Format Columns, Styled Columns) which apply only in specific Layouts

Collection of Layouts - can be Table or Pivot

Layout Extensions

LayoutExtension

Objects that apply only in one layout.

An Alert, Custom Sort, Flashing Cell, Format Column, Plus Minus nudge, Shortcut or Styled Column applies in every layout until its Name is listed here. Once listed, it applies only in the layouts that name it. LayoutName is the layout's Name. Each array is object names, not column ids.

Alert?

string[]

Names of Alert Definitions which apply in this Layout

CustomSort?

string[]

Names of Custom Sorts which apply in this Layout

FlashingCell?

string[]

Names of Flashing Cell Definitions which apply in this Layout

FormatColumn?

string[]

Names of Format Columns which apply in this Layout

Name of the Layout being extended (Mandatory)

PlusMinus?

string[]

Names of Plus Minus Nudges which apply in this Layout

Shortcut?

string[]

Names of Shortcuts which apply in this Layout

StyledColumn?

string[]

Names of Styled Columns which apply in this Layout

Base Layout Object

LayoutBase

Fields shared by a table layout and a pivot layout.

Name is required and is how CurrentLayout selects the layout. Sorts, filters, pinning, sizing, charts to open and row selection live here. The column list lives on or .

Whether Columns should autosize when Layout first loads

Collection of Column Filters to apply in Layout

Defines which Column Groups are expanded / collapsed

Set of custom header names for some (or all) Columns

Columns pinned to an edge. Each entry is a column id set to 'left' or 'right'. Columns absent from the map are not pinned.

Controls size (width or flex & min/max) for Columns

Sorting to apply in the Layout

GrandTotalRow?

'top' | 'bottom' | 'pinnedTop' | 'pinnedBottom' | boolean

Where the grand total row is shown.

'top', 'bottom', 'pinnedTop' or 'pinnedBottom'. true is the same as 'top'. false, or omitting the property, turns the grand total row off.

Grid Filter to apply in Layout

Name

string

Name of the Layout as it appears in the Layout toolbar and tool panel

AG Grid charts to open when this layout is selected (by chart UUID or name)

RowGroupDisplayType?

RowGroupDisplayType

How Row Groups are displayed: 'single' - one hierarchical group Column; 'multi' - a separate group Column per Row Grouped Column; 'groupRows' - full-width group rows (no group column); defaults to 'single'

Defines which Row Groups are expanded / collapsed

Defines Row Selection behaviour for Layout; if false, Row Selection is disabled; if undefined, GridOptions is used

Hides the aggFunc in Column header: e.g. 'sum(Price)' becomes 'Price'

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

Table Layout Object

TableLayout

A table layout.

TableColumns is required and is the column order. Row groups use RowGroupedColumns. Aggregations in grouped rows use TableAggregationColumns. Leave PivotColumns, PivotGroupedColumns, PivotExpandLevel and PivotAggregationColumns unset.

Extends

LayoutBase

Columns to hide. Each entry is a column id set to false. Columns absent from the map stay visible.

Columns which are row-grouped when the Layout is applied

Pinned Rows that display Aggregation Info for a whole Column

Columns showing aggregated values in Grouped Rows; a record of ColumnId and aggfunc (e.g. sum) or 'true' (to use default aggfunc)

TableColumns

string[]

Column ids in this layout, in display order. Required.

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

Column Visibility

ColumnVisibility is a ColumnBooleanFalseMap. A column id set to false is hidden. Pivot Layouts do not have this property.

Row Summary

Each entry in RowSummaries is a RowSummary:

RowSummary

A pinned row of column summaries in a table layout.

ColumnsMap is required: each key is a column id and each value is a summary name such as 'SUM' or 'AVG'. Position is 'Top' or 'Bottom'; omit it to pin the row to the bottom. IncludeOnlyFilteredRows defaults to true, so the summary uses the rows that pass the current filter. Suspend with IsSuspended. Requires AG Grid PinnedRowModule.

ColumnsMap

Record<string, SummarySupportedExpression>

Column id to summary name. Each value is a , for example 'SUM' or 'AVG'.

Evaluates only currently filtered rows in the summary

Default

true

'Top' pins the summary above the rows. 'Bottom' pins it below them. When omitted, the summary is pinned to the bottom.

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

IsSuspended?

boolean

Suspends (i.e. turns off) an Adaptable Object

Position is a RowSummaryPosition:

Value
'Top'
'Bottom'

Table Aggregation Columns

TableAggregationColumns is a list of aggregated columns:

{ ColumnId: string; AggFunc: AggregationColumnValue }[]

AggFunc is an AG Grid aggregation function name, true to use the column's default, or a WeightedAverageAggregation:

WeightedAverageAggregation

A weighted average of this column, weighted by another numeric column.

type

'weightedAverage'

Always 'weightedAverage'.

Column id whose values weight this average. That column is numeric.

Pivot Layout Object

PivotLayout

A pivot layout.

PivotColumns is required. Pass an empty array when the layout only shows aggregations. Row groups use PivotGroupedColumns. Aggregations use PivotAggregationColumns. Leave TableColumns, TableAggregationColumns and RowGroupedColumns unset.

Extends

LayoutBase

Columns showing aggregated values in Group Rows; 1st value in record is Column name, 2nd is either aggfunc (e.g. sum, avg etc.) or 'true' (to use default aggfunc)

PivotColumns

string[]

Mandatory list of Columns to pivot (provide empty array if just displaying Aggregations)

Display automatically calculated Totals within EACH Pivot Column Group, in the position specified

How deep to expand Pivot Columns (0 for none, 1 for 1st level only etc, -1 to expand all)

Display automatically calculated Totals of all Pivot Columns, in the position specified

Columns which are row-grouped when the Layout is applied

PivotResultColumnsOrder?

string[] | boolean

Ordered list of Pivot Result Columns; set to true to track current display order, or provide custom list

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

Pivot Aggregation Columns

PivotAggregationColumns is a list of aggregated columns:

{
  ColumnId: string;
  AggFunc: AggregationColumnValue;
  Total?: PivotTotalPosition | { PivotColumnId: string; ShowTotal?: PivotTotalPosition }[];
}[]

AggFunc is an AG Grid aggregation function name, true to use the column's default, or a WeightedAverageAggregation:

WeightedAverageAggregation

A weighted average of this column, weighted by another numeric column.

type

'weightedAverage'

Always 'weightedAverage'.

Column id whose values weight this average. That column is numeric.

PivotTotalPosition is:

Value
'before'
'after'
boolean

Both Layouts

These properties are on LayoutBase, so a Table Layout and a Pivot Layout both have them.

Column Filter

The ColumnFilters property is a collection of ColumnFilter objects defined as follows:

ColumnFilter

A filter on one column in a layout.

Expression is a boolean AdapTableQL expression and is what hides rows. PreferredFilter is only the operator shown in the filter UI before an expression exists; it does not hide rows. Setting Expression clears PreferredFilter. IsSuspended: true turns the filter off.

ColumnId

string

Column where Filter should be applied

Expression?

string

AdaptableQL boolean expression evaluated for each row, e.g.

[price] > 100 AND [price] < 200 OR [price] = 350

Mutually exclusive with : when
Expression is set, PreferredFilter is not persisted.

Preferred filter operator when there is no Expression (UI seed only —
does not filter rows). Uses AQL operator / function names, the same
vocabulary as columnFilterOptions.default*ColumnFilter (e.g. 'IN',
'STARTS_WITH', 'EQ').

Mutually exclusive with : set when the
user selects an operator before the filter is complete; removed as
soon as a valid Expression is persisted; restored from the current
UI operator when the Expression is cleared.

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

IsSuspended?

boolean

Suspends (i.e. turns off) an Adaptable Object

Grid Filter

The GridFilter object is defined as follows:

GridFilter

A boolean AdapTableQL expression applied to every row in a layout.

Rows that do not match Expression are hidden. An empty expression, or IsSuspended: true, shows every row. This is separate from each column's ColumnFilter.

Expression?

string

The (boolean) Expression to run

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

IsSuspended?

boolean

Suspends (i.e. turns off) an Adaptable Object

Column Sort

The ColumnSort object used for sorting is defined as follows:

ColumnSort

One column in a layout sort.

On Layout.ColumnSorts, the array order is the sort priority: the first entry is the primary sort. SortOrder is 'Asc' or 'Desc'.

ColumnId

string

Id of Column being sorted

SortOrder

'Asc' | 'Desc'

How Column is sorted - either 'Asc' or 'Desc'

Row Selection

The LayoutRowSelection object used for row selection is defined as follows:

LayoutRowSelection

Row selection for one layout, set on .

Mode is 'singleRow' or 'multiRow'. Omit RowSelection to keep gridOptions.rowSelection. Set RowSelection to false to turn selection off for that layout.

Checkboxes?

boolean

Whether to display checkboxes in Selection Column.
Overridden by LayoutOptions.isRowSelectionCheckboxVisible when that function is provided
(except when RowSelection is false, which disables selection entirely).

Default

true

Renders selection checkboxes in Auto-Group Column (if true) or in dedicated Selection Column (if false)

Default

false

EnableClickSelection?

boolean | 'enableDeselection' | 'enableSelection'

Selection behaviour when clicking a row: 'enableSelection' | 'enableDeselection' | true | false

Default

false

GroupSelectMode?

GroupSelectionMode

Grouping Select Mode: 'self' | 'descendants' | 'filteredDescendants'

Default

'self'

Whether to show checkbox in Header of Selection Column Header ('multiRow' only)

Default

true

Mode

'singleRow' | 'multiRow'

Row Selection Mode: 'singleRow' or 'multiRow'

SelectAllMode?

SelectAllMode

Select All Mode: 'all' | 'filtered' | 'currentPage'

Default

'all'

Column Pinning

ColumnPinning is a ColumnDirectionMap. Each column id is 'left' or 'right'.

Column Sizing

ColumnSizing is a ColumnSizingMap of ColumnSizingDefinition values. Set Width or Flex, not both.

PropertyTypeDescription
WidthnumberColumn width in pixels
FlexnumberFlex grow
ResizablebooleanWhether the column can be resized
MinWidthnumberMinimum width
MaxWidthnumberMaximum width

Column Headers

ColumnHeaders is a ColumnStringMap. Each column id maps to its header text.

Row Group Values

RowGroupValues is either { RowGroupDefaultBehavior: 'always-expanded' | 'always-collapsed' }, or a RowGroupValuesWithExceptionKeys: { RowGroupDefaultBehavior: 'expanded' | 'collapsed' } together with ExceptionGroupKeys or GroupKeys.

GroupKeys is defined as follows:

GroupKeys

Expand and collapse exceptions for one set of row-grouped columns.

AdapTable uses the entry whose RowGroupedColumns match the layout's current row-grouped columns. ExceptionGroupKeys are the group-key paths that do the opposite of RowGroupDefaultBehavior: collapsed when the default is 'expanded', expanded when the default is 'collapsed'.

Group-key paths that do the opposite of RowGroupDefaultBehavior. Each inner array is one path from the top group down.

Row-grouped column ids this exception list applies to. Matched against the layout's current row-grouped columns.

Column Group Values

ColumnGroupValues is either { ColumnGroupDefaultBehavior: 'always-expanded' | 'always-collapsed' }, or a ColumnGroupValuesWithExceptionKeys:

{
  ColumnGroupDefaultBehavior: 'expanded' | 'collapsed';
  ExceptionGroupKeys?: any[];
}

Open Charts

OpenCharts is a list of LayoutOpenChart objects:

LayoutOpenChart

Chart to open when a layout is applied

ChartName

string

Name of a persisted chart in Charting.ChartDefinitions (must be unique among all charts)

Optional chartContainers name, or omit for the AG Grid chart window


Layout Options

LayoutOptions

Options for configuring Layouts; manage Column visibility, order, sorting, grouping, width etc.

Creates a Default Layout based on AG Grid ColDefs, with optons to add a name and set if created on every load

Default

undefined

When a Calculated or Free Text Column is deleted, also remove it from all Layouts and layout properties

Default

true

Show controls for extending objects (e.g. Alerts, Format Columns) into Layouts - a Layouts step in wizards and Add/Remove buttons in Settings Panel

Default

false

Sets if Row Selection checkbox should be visible for a given row

Set of options for how Layouts are displayed in Settings Panel

pivotPreviewColumns?

string[] | ((context:PivotPreviewColumnsContext) => string[])

Columns to display in Table that opens when viewing Pivot Cell contents

Note

  • Use LayoutExtensions in Layout State (and enableLayoutExtensionsUI in Layout Options) to scope objects to Layouts. Object Tags do not control Layout membership.
  • autoCreateLayout builds a first-run Layout from AG Grid ColDefs when no Layouts exist. { createEveryLoad: true } rebuilds that Layout from ColDefs on every load. See Default Layouts.

This includes isRowSelectionCheckboxVisible for per-row Selection checkbox visibility — see Checkbox Visibility.

Layout View Options

Auto Create Layout

autoCreateLayout may be a boolean or an AutoCreateLayoutOptions object:

AutoCreateLayoutOptions

Configures Default Layout creation

Rebuild Layout from ColDefs on every load (edits persist but next load replaces them)

Default

false

name?

string

Name of Layout to create

Default

'Default Layout'

Default Properties

layoutCreationDefaultProperties is a LayoutCreationDefaultProperties object, or a function that receives LayoutCreationDefaultPropertiesContext and returns the table or pivot defaults:

tableLayout is Partial<Omit<TableLayout, 'Name'>>. pivotLayout is Partial<Omit<PivotLayout, 'Name'>>.

Row selection checkbox

isRowSelectionCheckboxVisible receives a LayoutRowSelectionContext:

LayoutRowSelectionContext

Context for LayoutOptions.isRowSelectionCheckboxVisible function

data

TData | undefined

The data in the Row Node.
undefined for group, footer, pinned, and other non-data rows — use rowNode for those cases.

Current Layout

rowNode

IRowNode<TData>

The Row Node being evaluated

Custom application Context provided in AdaptableOptions.adaptableContext

Pivot preview columns

pivotPreviewColumns is a column-id list, or a function that receives PivotPreviewColumnsContext:


Layout API

Full programmatic access to Layouts and related features is available in Layout API section of Adaptable API .

This enables Layouts to be accessed, created, edited, cloned, deleted and shared programmatically.

LayoutApi

Table and Pivot Layouts: the layout that is selected, its columns, sorts and row groups, and creating, cloning, editing and deleting layouts.

Adds a Column to Current Table or Pivot Layout

Extends an object into a Layout - once extended into any Layout, it applies only in those Layouts

Creates new Layout by cloning a given Layout and then loads it into Grid

Clones an Extended Layout - the new Layout is extended with the same objects

Creates new Layout by cloning a given Layout

Creates new Layout and loads it into Grid

Creates a new Layout

Creates (or Updates) an Extended Layout: saves the Layout, adds any extension objects not yet in state,
and makes those objects the Layout's complete Layout Extension

Creates new Layout into Adaptable State or updates an existing Layout (with same name or id)

Deletes an existing Layout (if not Default or only existing Layout)

Deletes a Layout by name. Does nothing when it is the only Layout.

Whether this Layout is already in Layout State. Compared by Uuid.

Retrieves Current Layout from Layout State

The sort direction of a column in the current Layout.

Name of the Layout that is selected.

Columns that group rows in the current Layout.

Column ids currently displayed in a Pivot Layout.

Column ids currently displayed in a Table Layout.

getCurrentVisibleColumnIdsMapForTableLayout()
returns

{ [key: string]: boolean; }

Column ids in the current Table Layout.

Retrieves the Layout with the given name, together with the objects extended into it
(global objects, which apply in every Layout, are not included)

Retrieves Layout by by the technical ID (from LayoutState)

Retrieves Layout with the given name

Retrieves the names of the objects, per Module, extended into a Layout

Retrieves all Layouts in Adaptable State

Retrieves the names of the Layouts an object is extended into (empty when the object is global)

The Layout section of Adaptable State.

Whether the current Layout is a Pivot Layout.

Opens Settings Panel with Layout section selected

Removes a Column from Current Table or Pivot Layout

Removes an object from a Layout - when it is no longer extended into any Layout, it becomes global

Renames a Layout, keeping the objects extended into it

Saves current Layout - using column order, visibility, sorting etc. currently in use in the grid

Sets a new Caption / Header for a Column (only for current Layout)

Sets (i.e. selects) the Extended Layout

Sets (i.e. selects) the Layout

Replaces the objects extended into a Layout (an empty extensionInfo makes those objects global again, unless
they are extended into other Layouts)

Extends an object into exactly the given Layouts, removing it from any others

Opens Change Column Caption popup

Opens Layout Editor - for Current or a named Layout

Updates current Layout using the partial Layout props provided in a function


Layout Changed Event

The Layout Changed Event fires whenever Layout State changes.

The Event Info is a single LayoutChangedInfo object. It includes the previous and current Layout State, plus:

  • actionName — why the Event fired
  • changedAreas — which parts of the current Layout changed, when the Layout is edited in place

Layout Changed Info

LayoutChangedInfo

Payload of the LayoutChanged event.

Fires when Layout State changes: the current Layout is ready, added, edited, saved, deleted or selected, and when a Column Filter or the Grid Filter on the current Layout changes.

Extends , so adaptableApi is included.

Which action caused this change. See .

Which parts of the current Layout changed.

Use this when you care what changed, rather than which actionName fired:

- LAYOUT_SAVE: diffs non-filter facets (e.g. ColumnSorting, RowGrouping)
- Column Filter actions: always ['ColumnFilter']
- Grid Filter actions: always ['GridFilter']

Omitted for layout identity changes (LAYOUT_SELECT, LAYOUT_ADD, LAYOUT_DELETE, LAYOUT_READY).

Layout State after this change.

Layout State before this change.

Absent for LAYOUT_READY, which fires once after startup and has no previous state.

Custom 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('LayoutChanged', (eventInfo: LayoutChangedInfo) => {
    // do something with the info
});

Layout Actions

Every Layout Changed Event includes an Action, which describes what caused the Layout to change.

This is provided using the actionName property which is of type LayoutChangedAction.

ActionDescription
LAYOUT_READYFired once after AdapTable starts, for the Layout that is already current
LAYOUT_ADDA Layout has been added
LAYOUT_EDITA Layout has been edited
LAYOUT_SAVEA Layout has been saved, including auto-save after grid edits (sort, grouping, columns, and so on)
LAYOUT_DELETEA Layout has been deleted
LAYOUT_SELECTA different Layout has been selected
LAYOUT_COLUMN_FILTER_ADDA Column Filter has been added
LAYOUT_COLUMN_FILTER_EDITA Column Filter has been edited
LAYOUT_COLUMN_FILTER_SETColumn Filters have been set
LAYOUT_COLUMN_FILTER_CLEARA Column Filter has been cleared
LAYOUT_COLUMN_FILTER_CLEAR_ALLAll Column Filters have been cleared
LAYOUT_COLUMN_FILTER_SUSPENDA Column Filter has been suspended
LAYOUT_COLUMN_FILTER_SUSPEND_ALLAll Column Filters have been suspended
LAYOUT_COLUMN_FILTER_UNSUSPENDA Column Filter has been unsuspended
LAYOUT_COLUMN_FILTER_UNSUSPEND_ALLAll Column Filters have been unsuspended
LAYOUT_GRID_FILTER_SETThe Grid Filter has been set
LAYOUT_GRID_FILTER_CLEARThe Grid Filter has been cleared
LAYOUT_GRID_FILTER_SUSPENDThe Grid Filter has been suspended
LAYOUT_GRID_FILTER_UNSUSPENDThe Grid Filter has been unsuspended

Layout Changed Areas

changedAreas is for when you care which part of the current Layout changed, without enumerating every filter actionName or deep-diffing Layout State.

It is only set when the current Layout is edited in place:

  • LAYOUT_SAVE — AdapTable diffs the previous and next Layout and lists the facets that actually changed (sort, grouping, columns, and so on)
  • any Column Filter action — always ['ColumnFilter']
  • any Grid Filter action — always ['GridFilter']

Caution

  • It is omitted for Layout identity changes: LAYOUT_SELECT, LAYOUT_ADD, LAYOUT_DELETE and LAYOUT_READY
  • Those change which Layout is current (or that a Layout exists), not a facet of the current one

Note

Column sizing is not included because AG Grid often reports incidental width or flex changes on unrelated edits

The possible values are of type LayoutChangedArea:

AreaDescription
ColumnsVisible columns or column order changed
ColumnPinningColumn pinning changed
ColumnHeadersColumn captions (or suppress agg func in header) changed
ColumnSortingColumn sorts changed
RowGroupingRow grouping (table or pivot) changed
AggregationsTable or pivot aggregations changed
RowSummariesRow summaries changed
RowSelectionLayout row-selection settings changed
ColumnFilterA Column Filter action fired
GridFilterA Grid Filter action fired
PivotingPivot columns, expand level or pivot totals changed

Find Out More

See Monitoring Layout Changes for a worked example