Layout Technical Reference

Summary

  • Layout State enables Table and Pivot Layouts to be configured
  • Layout Options contains many Layout related features
  • The Layout API contains many Layout-related functions

Layout State

Layout State contains a collection of Layouts and the Current Layout:

PropertyDescription
CurrentLayoutLayout to be loaded when AdapTable starts (using Name property in Layout); if not provided the first Layout is used
LayoutsCollection of Layouts - can be Table or Pivot

Base Layout Object

All Layouts derive from the LayoutBase object defined as follows:

PropertyDescription
AutoSizeColumnsWhether Columns should autosize when Layout first loads
ColumnFiltersCollection of Column Filters to apply in Layout
ColumnGroupValuesDefines which Column Groups are expanded / collapsed
ColumnHeadersSet of custom header names for some (or all) Columns
ColumnPinningDetails of which Columns are pinned
ColumnSizingControls size (width or flex & min/max) for Columns
ColumnSortsSorting to apply in the Layout
GrandTotalRowPosition of the Grand Total Row in the Layout
GridFilterGrid Filter to apply in Layout
NameName of the Layout as it appears in the Layout toolbar and tool panel
RowGroupDisplayTypeDisplay Row Grouped Columns as 'single' or 'multi' column
RowGroupValuesDefines which Row Groups are expanded / collapsed
SuppressAggFuncInHeaderHides the aggFunc in Column header: e.g. 'sum(Price)' becomes 'Price'
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

Table Layout Object

The Table Layout additionally includes these properties:

PropertyDescription
ColumnVisibilityMap of Table Column Visibility
RowGroupedColumnsColumns which are row-grouped when the Layout is applied
RowSummariesPinned Rows that display Aggregation Info for a whole Column
TableAggregationColumnsColumns showing aggregated values in Grouped Rows; a record of ColumnId and aggfunc (e.g. sum) or 'true' (to use default aggfunc)
TableColumnsList of Column Ids to include in Table Layout
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

Pivot Layout Object

The Pivot Layout additionally has:

PropertyDescription
PivotAggregationColumnsColumns 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)
PivotColumnsMandatory list of Columns to pivot (provide empty array if just displaying Aggregations)
PivotColumnTotalDisplay automatically calculated Totals within EACH Pivot Column Group, in the position specified
PivotExpandLevelHow deep to expand Pivot Columns (0 for none, 1 for 1st level only etc, -1 to expand all)
PivotGrandTotalDisplay automatically calculated Totals of all Pivot Columns, in the position specified
PivotGroupedColumnsColumns which are row-grouped when the Layout is applied
PivotResultColumnsOrderOrdered list of Pivot Result Columns; set to true to track current display order, or provide custom list
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

Column Filter

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

PropertyDescriptionDefault
ColumnIdColumn where Filter should be applied
PredicatesAdaptablePredicate which AdaptableQL will evaluate when the Filter is run
PredicatesOperatorLogic used when combining multiple Predicates ('AND'|'OR')'AND'
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
IsSuspendedSuspends (i.e. turns off) an Adaptable Object

Grid Filter

The GridFilter object is defined as follows:

PropertyDescription
ExpressionThe (boolean) Expression to run
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
IsSuspendedSuspends (i.e. turns off) an Adaptable Object

Column Sort

The ColumnSort object used for sorting is defined as follows:

PropertyDescription
ColumnIdId of Column being sorted
SortOrderHow Column is sorted - either 'Asc' or 'Desc'

Other Layout Properties

PropertyType
ColumnPinningColumnDirectionMap
ColumnSizingColumnSizingMap
ColumnVisibility (Table Layout only)ColumnBooleanFalseMap
ColumnHeadersColumnStringMap
RowGroupValuesRowGroupValues
ColumnGroupValuesColumnGroupValues

Note


Layout Options

The Layout Options section of Adaptable Options contains Layout-related configuration properties:

PropertyDescription
layoutCreationDefaultPropertiesDefault properties to apply when creating a new Layout (Table or Pivot)
layoutTagOptionsSet of options for leveraging Object Tags to extend Layouts
layoutViewOptionsSet of options for how Layouts are displayed in Settings Panel
pivotPreviewColumnsColumns to display in Table that opens when viewing Pivot Cell contents

Layout View Options

Layout View Options is used to configure how Layouts are viewed in the Settings Panel:

PropertyDescriptionDefault
maxColumnsToDisplayHow many Column Names to display in inline Layout preview10

Layout Tag Options

Layout Tag Options contains properties used when Extending Layouts:

PropertyDescriptionDefault
autoCheckTagsForLayoutsAutomatically assumes that any LayoutExtensionObject is available in the current Layout if it has a tag with the Layouts name (or no tags at all)false
autoGenerateTagsForLayoutsAutomatically generate an AdaptableObjectTag for each Layoutfalse
isObjectExtendedInLayoutChecks if provided Adaptable Object is extended in given Layout

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.

MethodDescription
addColumnToCurrentLayout(columnId)Adds a Column to Current Table or Pivot Layout
cloneAndSetLayout(layoutToClone, layoutName)Creates new Layout by cloning a given Layout and then loads it into Grid
cloneExtendedLayout(extendedLayoutToClone, layoutName)Clones an Extended Layout
cloneLayout(layoutToClone, layoutName)Creates new Layout by cloning a given Layout
createAndSetLayout(layoutToCreate)Creates new Layout and loads it into Grid
createLayout(layoutToCreate)Creates a new Layout
createOrUpdateExtendedLayout(extendedLayout)Creates (or Updates) an Extended Layout
createOrUpdateLayout(layout)Creates new Layout into Adaptable State or updates an existing Layout (with same name or id)
deleteLayout(layout)Deletes an existing Layout (if not Default or only existing Layout)
deleteLayoutByName(layoutName)Deletes an existing Layout provided by Name (if not Default or only existing Layout)
doesLayoutExist(layout)Checks whether this Layout exists in the Adaptable State (by comparing Uuid property)
getCurrentLayout()Retrieves Current Layout from Layout State
getCurrentLayoutColumnSort(columnId)Retrieves the sort order of a column from the current layout
getCurrentLayoutName()Retrieves name of current Layout
getCurrentRowGroupsColumnIds()Retrieves array of visible ColumnIds in current Layout
getCurrentVisibleColumnIdsForPivotLayout()Retrieves array of visible ColumnIds in current Pivot Layout
getCurrentVisibleColumnIdsForTableLayout()Retrieves array of visible ColumnIds in current Table Layout
getCurrentVisibleColumnIdsMapForTableLayout()Retrieves map with visible columns in current Table Layout
getExtendedLayoutByName(layoutName)Retrieves Layout with the given name
getLayoutById(id)Retrieves Layout by by the technical ID (from LayoutState)
getLayoutByName(layoutName)Retrieves Layout with the given name
getLayouts()Retrieves all Layouts in Adaptable State
getLayoutState()Retrieves Layout section from Adaptable State
isCurrentLayoutPivot()Returns true if current Layout is a Pivot Layout
openLayoutSettingsPanel()Opens Settings Panel with Layout section selected
removeColumnFromCurrentLayout(columnId)Removes a Column from Current Table or Pivot Layout
saveCurrentLayout()Saves current Layout - using column order, visibility, sorting etc. currently in use in the grid
setColumnCaption(columnId, caption)Sets a new Caption / Header for a Column (only for current Layout)
setExtendedLayout(extendedLayout)Sets (i.e. selects) the Extended Layout
setLayout(layoutName)Sets (i.e. selects) the Layout
showChangeColumnCaption(column)Opens Change Column Caption popup
showLayoutEditor(layoutName, layoutType, action)Opens Layout Editor - for Current or a named Layout
updateCurrentLayout(updateFn)Updates current Layout using the partial Layout props provided in a function