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:
| Property | Description |
|---|---|
| CurrentLayout | Layout to be loaded when AdapTable starts (using Name property in Layout); if not provided the first Layout is used |
| Layouts | Collection of Layouts - can be Table or Pivot |
Base Layout Object
All Layouts derive from the LayoutBase object defined as follows:
| Property | Description |
|---|---|
| AutoSizeColumns | Whether Columns should autosize when Layout first loads |
| ColumnFilters | Collection of Column Filters to apply in Layout |
| ColumnGroupValues | Defines which Column Groups are expanded / collapsed |
| ColumnHeaders | Set of custom header names for some (or all) Columns |
| ColumnPinning | Details of which Columns are pinned |
| ColumnSizing | Controls size (width or flex & min/max) for Columns |
| ColumnSorts | Sorting to apply in the Layout |
| GrandTotalRow | Position of the Grand Total Row in the Layout |
| GridFilter | Grid Filter to apply in Layout |
| Name | Name of the Layout as it appears in the Layout toolbar and tool panel |
| RowGroupDisplayType | Display Row Grouped Columns as 'single' or 'multi' column |
| RowGroupValues | Defines which Row Groups are expanded / collapsed |
| SuppressAggFuncInHeader | Hides the aggFunc in Column header: e.g. 'sum(Price)' becomes 'Price' |
| IsReadOnly | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') |
Table Layout Object
The Table Layout additionally includes these properties:
| Property | Description |
|---|---|
| ColumnVisibility | Map of Table Column Visibility |
| RowGroupedColumns | Columns which are row-grouped when the Layout is applied |
| RowSummaries | Pinned Rows that display Aggregation Info for a whole Column |
| TableAggregationColumns | Columns showing aggregated values in Grouped Rows; a record of ColumnId and aggfunc (e.g. sum) or 'true' (to use default aggfunc) |
| TableColumns | List of Column Ids to include in Table Layout |
| IsReadOnly | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') |
Pivot Layout Object
The Pivot Layout additionally has:
| Property | Description |
|---|---|
| PivotAggregationColumns | 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 | Mandatory list of Columns to pivot (provide empty array if just displaying Aggregations) |
| PivotColumnTotal | Display automatically calculated Totals within EACH Pivot Column Group, in the position specified |
| PivotExpandLevel | How deep to expand Pivot Columns (0 for none, 1 for 1st level only etc, -1 to expand all) |
| PivotGrandTotal | Display automatically calculated Totals of all Pivot Columns, in the position specified |
| PivotGroupedColumns | Columns which are row-grouped when the Layout is applied |
| PivotResultColumnsOrder | Ordered list of Pivot Result Columns; set to true to track current display order, or provide custom list |
| IsReadOnly | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') |
Column Filter
The ColumnFilters property is a collection of ColumnFilter objects defined as follows:
| Property | Description | Default |
|---|---|---|
| ColumnId | Column where Filter should be applied | |
| Predicates | AdaptablePredicate which AdaptableQL will evaluate when the Filter is run | |
| PredicatesOperator | Logic used when combining multiple Predicates ('AND'|'OR') | 'AND' |
| IsReadOnly | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') | |
| IsSuspended | Suspends (i.e. turns off) an Adaptable Object |
Grid Filter
The GridFilter object is defined as follows:
| Property | Description |
|---|---|
| Expression | The (boolean) Expression to run |
| IsReadOnly | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') |
| IsSuspended | Suspends (i.e. turns off) an Adaptable Object |
Column Sort
The ColumnSort object used for sorting is defined as follows:
| Property | Description |
|---|---|
| ColumnId | Id of Column being sorted |
| SortOrder | How Column is sorted - either 'Asc' or 'Desc' |
Other Layout Properties
| Property | Type |
|---|---|
ColumnPinning | ColumnDirectionMap |
ColumnSizing | ColumnSizingMap |
ColumnVisibility (Table Layout only) | ColumnBooleanFalseMap |
ColumnHeaders | ColumnStringMap |
RowGroupValues | RowGroupValues |
ColumnGroupValues | ColumnGroupValues |
Note
RowGroupValuescontains exceptions of typeRowGroupValuesWithExceptionKeysColumnGroupValuescontains exceptions of typeColumnGroupValuesWithExceptionKeys
Layout Options
The Layout Options section of Adaptable Options contains Layout-related configuration properties:
| Property | Description |
|---|---|
| layoutCreationDefaultProperties | Default properties to apply when creating a new Layout (Table or Pivot) |
| layoutTagOptions | Set of options for leveraging Object Tags to extend Layouts |
| layoutViewOptions | Set of options for how Layouts are displayed in Settings Panel |
| pivotPreviewColumns | Columns 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:
| Property | Description | Default |
|---|---|---|
| maxColumnsToDisplay | How many Column Names to display in inline Layout preview | 10 |
Layout Tag Options
Layout Tag Options contains properties used when Extending Layouts:
| Property | Description | Default |
|---|---|---|
| autoCheckTagsForLayouts | Automatically 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 |
| autoGenerateTagsForLayouts | Automatically generate an AdaptableObjectTag for each Layout | false |
| isObjectExtendedInLayout | Checks 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.
| Method | Description |
|---|---|
| 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 |