DashboardApi
Functions relating to the AdapTable Dashboard.
export interfaceMethods
| Method | Returns | Description |
|---|---|---|
| collapseDashboard() | void | Collapses Dashboard so only Dashboard Header is visible (and not Toolbars' contents) |
| dockDashboard() | void | Docks Dashboard so it 'snaps back' into its customary position above the grid |
| expandDashboard() | void | Expands Dashboard so Toolbars in Active Tab are fully visible |
| floatDashboard() | void | Floats Dashboard so only Dashboard Header is visible (in reduced size); can be dragged to a new location |
| getActiveTab() | DashboardTab | undefined | Returns current Active Tab (if there is one) |
| getActiveTabIndex() | number | undefined | Returns current Active Tab index (if there is one) |
| getCurrentToolbars() | AdaptableDashboardToolbars | string[] | Retrieves all Toolbars in Active Tab |
| getCustomDashboardButtonByLabel(buttonLabel) | AdaptableButton<DashboardButtonContext> | undefined | Retrieves first Custom Button with given Label |
| getCustomDashboardButtons() | AdaptableButton<DashboardButtonContext>[] | Retrieves all Custom Buttons |
| getCustomToolbarByName(customToolbarName) | CustomToolbar | Returns Custom Toolbar with the given name |
| getCustomToolbarHTMLElement(customToolbarName) | HTMLElement | null | Returns the HTML Element for the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a render function. |
| getCustomToolbars() | CustomToolbar[] | Retrieves all Custom Toolbars |
| getDashboardState() | DashboardState | Retrieves Dashboard section from Adaptable State |
| getModuleButtons() | AdaptableModuleButtons | Retrieves the Module Buttons in the Dashboard |
| getPinnedToolbars() | AdaptableDashboardToolbars | string[] | Retrieves pinned toolbars |
| getTabByName(tabName) | DashboardTab | Retrieves the Tab from State that matches inputted name |
| getTabs() | DashboardTab[] | Retrieves the Tabs in the Dashboard |
| hideDashboard() | void | Hides the Dashboard so cannot be seen |
| isDashboardCollapsed() | boolean | Is Dashboard Collapsed |
| isDashboardDocked() | boolean | Is Dashboard Docked |
| isDashboardExpanded() | boolean | Is Dashboard Expanded |
| isDashboardFloating() | boolean | Is Dashboard Floating |
| isDashboardHidden() | boolean | Is Dashboard Hidden |
| isDashboardVisible() | boolean | Is Dashboard Visible |
| isToolbarVisible(toolbar) | boolean | Checks if a given Toolbar is visible |
| openDashboardSettingsPanel() | void | Opens Settings Panel with Dashboard section selected and visible |
| refreshDashboard() | void | Refreshes entire Dashboard, including Toolbars and Buttons; particularly relevant for AdapTable built-in elements, as framework components are dependent on the framework specific change detection mechanisms |
| resetCustomToolbarFormData(customToolbarName) | void | Resets the data of a Custom Toolbar's toolbarForm back to the defaultValues declared on its fields - clearing any user input without unmounting / re-mounting the toolbar. |
| setActiveTab(tabName) | void | Sets Active Tab in Dashboard |
| setActiveTabIndex(tabIndex) | void | Sets Active Tab in Dashboard |
| setCustomToolbarHTMLContent(customToolbarName, htmlContent) | void | Renders the given HTML string in the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a render function! |
| setDashboardTitle(title) | void | Sets title of Dashboard Header |
| setModuleButtons(moduleButtons) | void | Sets which Module Buttons are visible |
| setPinnedToolbars(toolbars) | void | Sets pinned toolbars |
| setTabs(Tabs) | void | Updates the Tabs in the Dashboard |
| showDashboard() | void | Makes the Dashboard visible |
Method Details
collapseDashboard
Collapses Dashboard so only Dashboard Header is visible (and not Toolbars' contents)
collapseDashboard(): void;Returns
void
dockDashboard
Docks Dashboard so it 'snaps back' into its customary position above the grid
dockDashboard(): void;Returns
void
expandDashboard
Expands Dashboard so Toolbars in Active Tab are fully visible
expandDashboard(): void;Returns
void
floatDashboard
Floats Dashboard so only Dashboard Header is visible (in reduced size); can be dragged to a new location
floatDashboard(): void;Returns
void
getActiveTab
Returns current Active Tab (if there is one)
getActiveTab(): DashboardTab | undefined;Returns
DashboardTab | undefined
getActiveTabIndex
Returns current Active Tab index (if there is one)
getActiveTabIndex(): number | undefined;Returns
number | undefined
getCurrentToolbars
Retrieves all Toolbars in Active Tab
getCurrentToolbars(): AdaptableDashboardToolbars | string[];Returns
AdaptableDashboardToolbars | string[]
getCustomDashboardButtonByLabel
Retrieves first Custom Button with given Label
getCustomDashboardButtonByLabel(buttonLabel: string): AdaptableButton<DashboardButtonContext> | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| buttonLabel | string | the label of the Custom Button to retrieve |
Returns
AdaptableButton<DashboardButtonContext> | undefined
getCustomDashboardButtons
Retrieves all Custom Buttons
getCustomDashboardButtons(): AdaptableButton<DashboardButtonContext>[];Returns
AdaptableButton<DashboardButtonContext>[]
getCustomToolbarByName
Returns Custom Toolbar with the given name
getCustomToolbarByName(customToolbarName: string): CustomToolbar;Parameters
| Parameter | Type | Description |
|---|---|---|
| customToolbarName | string | the name of the Custom Toolbar |
Returns
getCustomToolbarHTMLElement
Returns the HTML Element for the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a render function.
getCustomToolbarHTMLElement(customToolbarName: string): HTMLElement | null;Parameters
| Parameter | Type | Description |
|---|---|---|
| customToolbarName | string | the name of the Custom Toolbar |
Returns
HTMLElement | null
getCustomToolbars
Retrieves all Custom Toolbars
getCustomToolbars(): CustomToolbar[];Returns
getDashboardState
Retrieves Dashboard section from Adaptable State
getDashboardState(): DashboardState;Returns
getModuleButtons
Retrieves the Module Buttons in the Dashboard
getModuleButtons(): AdaptableModuleButtons;Returns
AdaptableModuleButtons
getPinnedToolbars
Retrieves pinned toolbars
getPinnedToolbars(): AdaptableDashboardToolbars | string[];Returns
AdaptableDashboardToolbars | string[]
getTabByName
Retrieves the Tab from State that matches inputted name
getTabByName(tabName: string): DashboardTab;Parameters
| Parameter | Type | Description |
|---|---|---|
| tabName | string | the tab to check |
Returns
getTabs
Retrieves the Tabs in the Dashboard
getTabs(): DashboardTab[];Returns
hideDashboard
Hides the Dashboard so cannot be seen
hideDashboard(): void;Returns
void
isDashboardCollapsed
Is Dashboard Collapsed
isDashboardCollapsed(): boolean;Returns
boolean
isDashboardDocked
Is Dashboard Docked
isDashboardDocked(): boolean;Returns
boolean
isDashboardExpanded
Is Dashboard Expanded
isDashboardExpanded(): boolean;Returns
boolean
isDashboardFloating
Is Dashboard Floating
isDashboardFloating(): boolean;Returns
boolean
isDashboardHidden
Is Dashboard Hidden
isDashboardHidden(): boolean;Returns
boolean
isDashboardVisible
Is Dashboard Visible
isDashboardVisible(): boolean;Returns
boolean
isToolbarVisible
Checks if a given Toolbar is visible
isToolbarVisible(toolbar: AdaptableDashboardToolbar | string): boolean;Parameters
| Parameter | Type | Description |
|---|---|---|
| toolbar | AdaptableDashboardToolbar | string | toolbar to check visibility for |
Returns
boolean
openDashboardSettingsPanel
Opens Settings Panel with Dashboard section selected and visible
openDashboardSettingsPanel(): void;Returns
void
refreshDashboard
Refreshes entire Dashboard, including Toolbars and Buttons; particularly relevant for AdapTable built-in elements, as framework components are dependent on the framework specific change detection mechanisms
refreshDashboard(): void;Returns
void
resetCustomToolbarFormData
Resets the data of a Custom Toolbar's toolbarForm back to the defaultValues declared on its fields - clearing any user input without unmounting / re-mounting the toolbar.
Useful for "Clear filters" buttons that need to wipe both the grid filter AND the toolbar form's internal state in a single click.
resetCustomToolbarFormData(customToolbarName?: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| customToolbarName | string | Name of the Custom Toolbar to reset. If omitted, every Custom Toolbar that currently hosts a toolbarForm is reset. |
Returns
void
setActiveTab
Sets Active Tab in Dashboard
setActiveTab(tabName: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| tabName | string | name of tab to set |
Returns
void
setActiveTabIndex
Sets Active Tab in Dashboard
setActiveTabIndex(tabIndex: number): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| tabIndex | number | the tab index to set |
Returns
void
setCustomToolbarHTMLContent
Renders the given HTML string in the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a render function!
setCustomToolbarHTMLContent(customToolbarName: string, htmlContent: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| customToolbarName | string | name of Custom Toolbar hosting content |
| htmlContent | string | HTML string to render |
Returns
void
setDashboardTitle
Sets title of Dashboard Header
setDashboardTitle(title: string): void;Parameters
| Parameter | Type |
|---|---|
| title | string |
Returns
void
setModuleButtons
Sets which Module Buttons are visible
setModuleButtons(moduleButtons: AdaptableModuleButtons): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| moduleButtons | AdaptableModuleButtons | buttons to show |
Returns
void
setPinnedToolbars
Sets pinned toolbars
setPinnedToolbars(toolbars: AdaptableDashboardToolbars | string[]): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| toolbars | AdaptableDashboardToolbars | string[] |
Returns
void
setTabs
Updates the Tabs in the Dashboard
setTabs(Tabs: DashboardTab[]): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| Tabs | DashboardTab[] |
Returns
void
showDashboard
Makes the Dashboard visible
showDashboard(): void;Returns
void