LayoutApi
Provides run-time access to the Layout Module and associated state
export interfaceMethods
| 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 |
Method Details
addColumnToCurrentLayout
Adds a Column to Current Table or Pivot Layout
addColumnToCurrentLayout(columnId: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| columnId | string | Column to add |
Returns
void
cloneAndSetLayout
Creates new Layout by cloning a given Layout and then loads it into Grid
cloneAndSetLayout(layoutToClone: Layout, layoutName: string): Layout | false;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutToClone | Layout | Layout to clone |
| layoutName | string | name to use for new Layout |
Returns
Layout | false
cloneExtendedLayout
Clones an Extended Layout
cloneExtendedLayout(extendedLayoutToClone: ExtendedLayout, layoutName: string): ExtendedLayout | false;Parameters
| Parameter | Type | Description |
|---|---|---|
| extendedLayoutToClone | ExtendedLayout | ExtendedLayout to Clone |
| layoutName | string | New name for Layout being cloned |
Returns
ExtendedLayout | false
cloneLayout
Creates new Layout by cloning a given Layout
cloneLayout(layoutToClone: Layout, layoutName: string): Layout | false;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutToClone | Layout | Layout to clone |
| layoutName | string | name of new Layout |
Returns
Layout | false
createAndSetLayout
Creates new Layout and loads it into Grid
createAndSetLayout(layoutToCreate: Layout): Layout | false;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutToCreate | Layout | Layout to create |
Returns
Layout | false
createLayout
Creates a new Layout
createLayout(layoutToCreate: Layout): Layout | false;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutToCreate | Layout | Layout to create |
Returns
Layout | false
createOrUpdateExtendedLayout
Creates (or Updates) an Extended Layout
createOrUpdateExtendedLayout(extendedLayout: ExtendedLayout): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| extendedLayout | ExtendedLayout | ExtendedLayout to Create |
Returns
void
createOrUpdateLayout
Creates new Layout into Adaptable State or updates an existing Layout (with same name or id)
createOrUpdateLayout(layout: Layout): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| layout | Layout | the Layout to create or update |
Returns
void
deleteLayout
Deletes an existing Layout (if not Default or only existing Layout)
deleteLayout(layout: Layout): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| layout | Layout | The Layout to delete |
Returns
void
deleteLayoutByName
Deletes an existing Layout provided by Name (if not Default or only existing Layout)
deleteLayoutByName(layoutName: string): void;Parameters
| Parameter | Type |
|---|---|
| layoutName | string |
Returns
void
doesLayoutExist
Checks whether this Layout exists in the Adaptable State (by comparing Uuid property)
doesLayoutExist(layout: Layout): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
| layout | Layout | Layout to check |
Returns
boolean
getCurrentLayout
Retrieves Current Layout from Layout State
getCurrentLayout(): Layout;Returns
getCurrentLayoutColumnSort
Retrieves the sort order of a column from the current layout
getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;Parameters
| Parameter | Type | Description |
|---|---|---|
| columnId | string | Column id |
Returns
ColumnSort['SortOrder'] | null
getCurrentLayoutName
Retrieves name of current Layout
getCurrentLayoutName(): string;Returns
string
getCurrentRowGroupsColumnIds
Retrieves array of visible ColumnIds in current Layout
getCurrentRowGroupsColumnIds(): string[];Returns
string[]
getCurrentVisibleColumnIdsForPivotLayout
Retrieves array of visible ColumnIds in current Pivot Layout
getCurrentVisibleColumnIdsForPivotLayout(): string[];Returns
string[]
getCurrentVisibleColumnIdsForTableLayout
Retrieves array of visible ColumnIds in current Table Layout
getCurrentVisibleColumnIdsForTableLayout(): string[];Returns
string[]
getCurrentVisibleColumnIdsMapForTableLayout
Retrieves map with visible columns in current Table Layout
getCurrentVisibleColumnIdsMapForTableLayout(): {
[key: string]: boolean;
};Returns
\{ [key: string]: boolean; \}
getExtendedLayoutByName
Retrieves Layout with the given name
getExtendedLayoutByName(layoutName: string): ExtendedLayout | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutName | string | Layout to retrieve |
Returns
ExtendedLayout | undefined
getLayoutById
Retrieves Layout by by the technical ID (from LayoutState)
getLayoutById(id: Layout['Uuid']): Layout;Parameters
| Parameter | Type | Description |
|---|---|---|
| id | Layout['Uuid'] | Layout id |
Returns
getLayoutByName
Retrieves Layout with the given name
getLayoutByName(layoutName: string): Layout | null;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutName | string | Layout to retrieve |
Returns
Layout | null
getLayouts
Retrieves all Layouts in Adaptable State
getLayouts(): Layout[];Returns
Layout[]
getLayoutState
Retrieves Layout section from Adaptable State
getLayoutState(): LayoutState;Returns
isCurrentLayoutPivot
Returns true if current Layout is a Pivot Layout
isCurrentLayoutPivot(): boolean;Returns
boolean
openLayoutSettingsPanel
Opens Settings Panel with Layout section selected
openLayoutSettingsPanel(): void;Returns
void
removeColumnFromCurrentLayout
Removes a Column from Current Table or Pivot Layout
removeColumnFromCurrentLayout(columnId: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| columnId | string | Column to remove |
Returns
void
saveCurrentLayout
Saves current Layout - using column order, visibility, sorting etc. currently in use in the grid
saveCurrentLayout(): void;Returns
void
setColumnCaption
Sets a new Caption / Header for a Column (only for current Layout)
setColumnCaption(columnId: string, caption: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| columnId | string | Column to Update |
| caption | string | New Caption to display |
Returns
void
setExtendedLayout
Sets (i.e. selects) the Extended Layout
setExtendedLayout(extendedLayout: ExtendedLayout): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| extendedLayout | ExtendedLayout | Extended Layout to set |
Returns
void
setLayout
Sets (i.e. selects) the Layout
setLayout(layoutName: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutName | string | Layout to set (has to be name of existing Layout) |
Returns
void
showChangeColumnCaption
Opens Change Column Caption popup
showChangeColumnCaption(column: AdaptableColumn): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| column | AdaptableColumn | Column to open Popup for |
Returns
void
showLayoutEditor
Opens Layout Editor - for Current or a named Layout
showLayoutEditor(layoutName?: string, layoutType?: 'table' | 'pivot',
action?: 'New' | 'Clone' | 'Edit'): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| layoutName | string | Name 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
updateCurrentLayout(updateFn: (layout: TableLayout | PivotLayout) => TableLayout | PivotLayout): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| updateFn | (layout:TableLayout|PivotLayout) =>TableLayout|PivotLayout | a function which returns a full Layout |
Returns
void