Layout Technical Reference
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.
string
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.
string[]
Names of Alert Definitions which apply in this Layout
string[]
Names of Custom Sorts which apply in this Layout
string[]
Names of Flashing Cell Definitions which apply in this Layout
string[]
Names of Format Columns which apply in this Layout
string
Name of the Layout being extended (Mandatory)
string[]
Names of Plus Minus Nudges which apply in this Layout
string[]
Names of Shortcuts which apply in this Layout
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 .
boolean
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
'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
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
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
LayoutRowSelection | false
Defines Row Selection behaviour for Layout; if false, Row Selection is disabled; if undefined, GridOptions is used
boolean
Hides the aggFunc in Column header: e.g. 'sum(Price)' becomes 'Price'
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.
Columns to hide. Each entry is a column id set to false. Columns absent from the map stay visible.
string[]
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)
string[]
Column ids in this layout, in display order. Required.
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.
Record<string, SummarySupportedExpression>
Column id to summary name. Each value is a , for example 'SUM' or 'AVG'.
'Top' pins the summary above the rows. 'Bottom' pins it below them. When omitted, the summary is pinned to the bottom.
boolean
Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
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.
'weightedAverage'
Always 'weightedAverage'.
string
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.
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)
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
number
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
string[]
Columns which are row-grouped when the Layout is applied
string[] | boolean
Ordered list of Pivot Result Columns; set to true to track current display order, or provide custom list
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.
'weightedAverage'
Always 'weightedAverage'.
string
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.
string
Column where Filter should be applied
string
AdaptableQL boolean expression evaluated for each row, e.g.[price] > 100 AND [price] < 200 OR [price] = 350
Mutually exclusive with : whenExpression is set, PreferredFilter is not persisted.
string
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.
boolean
Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
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.
string
The (boolean) Expression to run
boolean
Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
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'.
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.
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).
true
boolean
Renders selection checkboxes in Auto-Group Column (if true) or in dedicated Selection Column (if false)
false
boolean | 'enableDeselection' | 'enableSelection'
Selection behaviour when clicking a row: 'enableSelection' | 'enableDeselection' | true | false
false
GroupSelectionMode
Grouping Select Mode: 'self' | 'descendants' | 'filteredDescendants'
'self'
boolean
Whether to show checkbox in Header of Selection Column Header ('multiRow' only)
true
'singleRow' | 'multiRow'
Row Selection Mode: 'singleRow' or 'multiRow'
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.
| Property | Type | Description |
|---|---|---|
Width | number | Column width in pixels |
Flex | number | Flex grow |
Resizable | boolean | Whether the column can be resized |
MinWidth | number | Minimum width |
MaxWidth | number | Maximum 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'.
any[][]
Group-key paths that do the opposite of RowGroupDefaultBehavior. Each inner array is one path from the top group down.
string[]
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
string
Name of a persisted chart in Charting.ChartDefinitions (must be unique among all charts)
string
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.
boolean |AutoCreateLayoutOptions
Creates a Default Layout based on AG Grid ColDefs, with optons to add a name and set if created on every load
undefined
When a Calculated or Free Text Column is deleted, also remove it from all Layouts and layout properties
true
boolean
Show controls for extending objects (e.g. Alerts, Format Columns) into Layouts - a Layouts step in wizards and Add/Remove buttons in Settings Panel
false
(context:LayoutRowSelectionContext<TData>) => boolean
Sets if Row Selection checkbox should be visible for a given row
Default properties to apply when creating a new Layout (Table or Pivot)
Set of options for how Layouts are displayed in Settings Panel
string[] | ((context:PivotPreviewColumnsContext) => string[])
Columns to display in Table that opens when viewing Pivot Cell contents
Note
- Use
LayoutExtensionsin Layout State (andenableLayoutExtensionsUIin Layout Options) to scope objects to Layouts. Object Tags do not control Layout membership. autoCreateLayoutbuilds 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
LayoutViewOptions
Customize how Layouts are displayed in Settings Panel
Auto Create Layout
autoCreateLayout may be a boolean or an AutoCreateLayoutOptions object:
AutoCreateLayoutOptions
Configures Default Layout creation
boolean
Rebuild Layout from ColDefs on every load (edits persist but next load replaces them)
false
Default Properties
layoutCreationDefaultProperties is a LayoutCreationDefaultProperties object, or a function that receives LayoutCreationDefaultPropertiesContext and returns the table or pivot defaults:
LayoutCreationDefaultProperties
Default properties to apply when creating a new Layout (Table or Pivot)
Default properties to apply when creating a new Pivot Layout
Default properties to apply when creating a new Table Layout
tableLayout is Partial<Omit<TableLayout, 'Name'>>. pivotLayout is Partial<Omit<PivotLayout, 'Name'>>.
LayoutCreationDefaultPropertiesContext
Context for LayoutOptions.layoutCreationDefaultProperties function
'table' | 'pivot'
Type of Layout ('table' | 'pivot')
Custom application Context provided in AdaptableOptions.adaptableContext
Row selection checkbox
isRowSelectionCheckboxVisible receives a LayoutRowSelectionContext:
LayoutRowSelectionContext
Context for LayoutOptions.isRowSelectionCheckboxVisible function
AdaptableColumnContext<TData>
Pivot preview columns
pivotPreviewColumns is a column-id list, or a function that receives PivotPreviewColumnsContext:
PivotPreviewColumnsContext
Context uses for pivotPreviewColumns function in Layout Options
string
Column being opened
Custom application Context provided in AdaptableOptions.adaptableContext
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.
void
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
Layout | false
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
Layout | false
Creates new Layout by cloning a given Layout
Layout | false
Creates new Layout and loads it into Grid
Layout | false
Creates a new Layout
void
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
void
Creates new Layout into Adaptable State or updates an existing Layout (with same name or id)
void
Deletes an existing Layout (if not Default or only existing Layout)
void
Deletes a Layout by name. Does nothing when it is the only Layout.
boolean
Whether this Layout is already in Layout State. Compared by Uuid.
Retrieves Current Layout from Layout State
ColumnSort['SortOrder'] | null
The sort direction of a column in the current Layout.
string
Name of the Layout that is selected.
string[]
Columns that group rows in the current Layout.
string[]
Column ids currently displayed in a Pivot Layout.
string[]
Column ids currently displayed in a Table Layout.
{ [key: string]: boolean; }
Column ids in the current Table Layout.
ExtendedLayout | undefined
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)
Layout | null
Retrieves Layout with the given name
Retrieves the names of the objects, per Module, extended into a Layout
Layout[]
Retrieves all Layouts in Adaptable State
string[]
Retrieves the names of the Layouts an object is extended into (empty when the object is global)
The Layout section of Adaptable State.
boolean
Whether the current Layout is a Pivot Layout.
void
Opens Settings Panel with Layout section selected
void
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
boolean
Renames a Layout, keeping the objects extended into it
void
Saves current Layout - using column order, visibility, sorting etc. currently in use in the grid
void
Sets a new Caption / Header for a Column (only for current Layout)
void
Sets (i.e. selects) the Extended Layout
void
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
void
Opens Change Column Caption popup
Opens Layout Editor - for Current or a named Layout
void
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 firedchangedAreas— 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.
LayoutState | undefined
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.
| Action | Description |
|---|---|
LAYOUT_READY | Fired once after AdapTable starts, for the Layout that is already current |
LAYOUT_ADD | A Layout has been added |
LAYOUT_EDIT | A Layout has been edited |
LAYOUT_SAVE | A Layout has been saved, including auto-save after grid edits (sort, grouping, columns, and so on) |
LAYOUT_DELETE | A Layout has been deleted |
LAYOUT_SELECT | A different Layout has been selected |
LAYOUT_COLUMN_FILTER_ADD | A Column Filter has been added |
LAYOUT_COLUMN_FILTER_EDIT | A Column Filter has been edited |
LAYOUT_COLUMN_FILTER_SET | Column Filters have been set |
LAYOUT_COLUMN_FILTER_CLEAR | A Column Filter has been cleared |
LAYOUT_COLUMN_FILTER_CLEAR_ALL | All Column Filters have been cleared |
LAYOUT_COLUMN_FILTER_SUSPEND | A Column Filter has been suspended |
LAYOUT_COLUMN_FILTER_SUSPEND_ALL | All Column Filters have been suspended |
LAYOUT_COLUMN_FILTER_UNSUSPEND | A Column Filter has been unsuspended |
LAYOUT_COLUMN_FILTER_UNSUSPEND_ALL | All Column Filters have been unsuspended |
LAYOUT_GRID_FILTER_SET | The Grid Filter has been set |
LAYOUT_GRID_FILTER_CLEAR | The Grid Filter has been cleared |
LAYOUT_GRID_FILTER_SUSPEND | The Grid Filter has been suspended |
LAYOUT_GRID_FILTER_UNSUSPEND | The 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_DELETEandLAYOUT_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:
| Area | Description |
|---|---|
Columns | Visible columns or column order changed |
ColumnPinning | Column pinning changed |
ColumnHeaders | Column captions (or suppress agg func in header) changed |
ColumnSorting | Column sorts changed |
RowGrouping | Row grouping (table or pivot) changed |
Aggregations | Table or pivot aggregations changed |
RowSummaries | Row summaries changed |
RowSelection | Layout row-selection settings changed |
ColumnFilter | A Column Filter action fired |
GridFilter | A Grid Filter action fired |
Pivoting | Pivot columns, expand level or pivot totals changed |
Find Out More
See Monitoring Layout Changes for a worked example