Provides run-time access to the Layout Module and associated state

TypeScript
export interface

Methods

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

Method Details

addColumnToCurrentLayout

Adds a Column to Current Table or Pivot Layout

TypeScript
addColumnToCurrentLayout(columnId: string): void;
Parameters
ParameterTypeDescription
columnIdstringColumn to add
Returns

void

cloneAndSetLayout

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

TypeScript
cloneAndSetLayout(layoutToClone: Layout, layoutName: string): Layout | false;
Parameters
ParameterTypeDescription
layoutToCloneLayoutLayout to clone
layoutNamestringname to use for new Layout
Returns

Layout | false

cloneExtendedLayout

Clones an Extended Layout

TypeScript
cloneExtendedLayout(extendedLayoutToClone: ExtendedLayout, layoutName: string): ExtendedLayout | false;
Parameters
ParameterTypeDescription
extendedLayoutToCloneExtendedLayoutExtendedLayout to Clone
layoutNamestringNew name for Layout being cloned
Returns

ExtendedLayout | false

cloneLayout

Creates new Layout by cloning a given Layout

TypeScript
cloneLayout(layoutToClone: Layout, layoutName: string): Layout | false;
Parameters
ParameterTypeDescription
layoutToCloneLayoutLayout to clone
layoutNamestringname of new Layout
Returns

Layout | false

createAndSetLayout

Creates new Layout and loads it into Grid

TypeScript
createAndSetLayout(layoutToCreate: Layout): Layout | false;
Parameters
ParameterTypeDescription
layoutToCreateLayoutLayout to create
Returns

Layout | false

createLayout

Creates a new Layout

TypeScript
createLayout(layoutToCreate: Layout): Layout | false;
Parameters
ParameterTypeDescription
layoutToCreateLayoutLayout to create
Returns

Layout | false

createOrUpdateExtendedLayout

Creates (or Updates) an Extended Layout

TypeScript
createOrUpdateExtendedLayout(extendedLayout: ExtendedLayout): void;
Parameters
ParameterTypeDescription
extendedLayoutExtendedLayoutExtendedLayout to Create
Returns

void

createOrUpdateLayout

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

TypeScript
createOrUpdateLayout(layout: Layout): void;
Parameters
ParameterTypeDescription
layoutLayoutthe Layout to create or update
Returns

void

deleteLayout

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

TypeScript
deleteLayout(layout: Layout): void;
Parameters
ParameterTypeDescription
layoutLayoutThe Layout to delete
Returns

void

deleteLayoutByName

Deletes an existing Layout provided by Name (if not Default or only existing Layout)

TypeScript
deleteLayoutByName(layoutName: string): void;
Parameters
ParameterType
layoutNamestring
Returns

void

doesLayoutExist

Checks whether this Layout exists in the Adaptable State (by comparing Uuid property)

TypeScript
doesLayoutExist(layout: Layout): boolean;
Parameters
ParameterTypeDescription
layoutLayoutLayout to check
Returns

boolean

getCurrentLayout

Retrieves Current Layout from Layout State

TypeScript
getCurrentLayout(): Layout;
Returns

Layout

getCurrentLayoutColumnSort

Retrieves the sort order of a column from the current layout

TypeScript
getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
Parameters
ParameterTypeDescription
columnIdstringColumn id
Returns

ColumnSort['SortOrder'] | null

getCurrentLayoutName

Retrieves name of current Layout

TypeScript
getCurrentLayoutName(): string;
Returns

string

getCurrentRowGroupsColumnIds

Retrieves array of visible ColumnIds in current Layout

TypeScript
getCurrentRowGroupsColumnIds(): string[];
Returns

string[]

getCurrentVisibleColumnIdsForPivotLayout

Retrieves array of visible ColumnIds in current Pivot Layout

TypeScript
getCurrentVisibleColumnIdsForPivotLayout(): string[];
Returns

string[]

getCurrentVisibleColumnIdsForTableLayout

Retrieves array of visible ColumnIds in current Table Layout

TypeScript
getCurrentVisibleColumnIdsForTableLayout(): string[];
Returns

string[]

getCurrentVisibleColumnIdsMapForTableLayout

Retrieves map with visible columns in current Table Layout

TypeScript
getCurrentVisibleColumnIdsMapForTableLayout(): {
        [key: string]: boolean;
    };
Returns

\{ [key: string]: boolean; \}

getExtendedLayoutByName

Retrieves Layout with the given name

TypeScript
getExtendedLayoutByName(layoutName: string): ExtendedLayout | undefined;
Parameters
ParameterTypeDescription
layoutNamestringLayout to retrieve
Returns

ExtendedLayout | undefined

getLayoutById

Retrieves Layout by by the technical ID (from LayoutState)

TypeScript
getLayoutById(id: Layout['Uuid']): Layout;
Parameters
ParameterTypeDescription
idLayout['Uuid']Layout id
Returns

Layout

getLayoutByName

Retrieves Layout with the given name

TypeScript
getLayoutByName(layoutName: string): Layout | null;
Parameters
ParameterTypeDescription
layoutNamestringLayout to retrieve
Returns

Layout | null

getLayouts

Retrieves all Layouts in Adaptable State

TypeScript
getLayouts(): Layout[];
Returns

Layout[]

getLayoutState

Retrieves Layout section from Adaptable State

TypeScript
getLayoutState(): LayoutState;
Returns

LayoutState

isCurrentLayoutPivot

Returns true if current Layout is a Pivot Layout

TypeScript
isCurrentLayoutPivot(): boolean;
Returns

boolean

openLayoutSettingsPanel

Opens Settings Panel with Layout section selected

TypeScript
openLayoutSettingsPanel(): void;
Returns

void

removeColumnFromCurrentLayout

Removes a Column from Current Table or Pivot Layout

TypeScript
removeColumnFromCurrentLayout(columnId: string): void;
Parameters
ParameterTypeDescription
columnIdstringColumn to remove
Returns

void

saveCurrentLayout

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

TypeScript
saveCurrentLayout(): void;
Returns

void

setColumnCaption

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

TypeScript
setColumnCaption(columnId: string, caption: string): void;
Parameters
ParameterTypeDescription
columnIdstringColumn to Update
captionstringNew Caption to display
Returns

void

setExtendedLayout

Sets (i.e. selects) the Extended Layout

TypeScript
setExtendedLayout(extendedLayout: ExtendedLayout): void;
Parameters
ParameterTypeDescription
extendedLayoutExtendedLayoutExtended Layout to set
Returns

void

setLayout

Sets (i.e. selects) the Layout

TypeScript
setLayout(layoutName: string): void;
Parameters
ParameterTypeDescription
layoutNamestringLayout to set (has to be name of existing Layout)
Returns

void

showChangeColumnCaption

Opens Change Column Caption popup

TypeScript
showChangeColumnCaption(column: AdaptableColumn): void;
Parameters
ParameterTypeDescription
columnAdaptableColumnColumn to open Popup for
Returns

void

showLayoutEditor

Opens Layout Editor - for Current or a named Layout

TypeScript
showLayoutEditor(layoutName?: string, layoutType?: 'table' | 'pivot', 
    action?: 'New' | 'Clone' | 'Edit'): void;
Parameters
ParameterTypeDescription
layoutNamestringName of Layout to be edited or cloned; if not specified, uses Current Layout
layoutType'table' | 'pivot'
action'New' | 'Clone' | 'Edit'Whether to edit, clone, or create a new Layout
Returns

void

updateCurrentLayout

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

TypeScript
updateCurrentLayout(updateFn: (layout: TableLayout | PivotLayout) => TableLayout | PivotLayout): void;
Parameters
ParameterTypeDescription
updateFn(layout:TableLayout|PivotLayout) =>TableLayout|PivotLayouta function which returns a full Layout
Returns

void