Dashboard Technical Reference

Summary

  • The Dashboard can be accessed at run-time through 2 events:
    • Dashboard Changed - which fires when anything changes in the Dashboard
    • Custom Toolbar Configured - which allows a custom toolbar to be updated
  • Dashboard State and Dashboard Options provide design-time configuration Options
  • Dashboard API provides run-time access to the Dashboard

Dashboard State

The Dashboard State section contains Dashboard properties that are editable at run-time:

PropertyTypeDescriptionDefault
ActiveTabIndexnumberIndex of Active Tab (in Tabs collection)
DashboardTitlestringTitle displayed in Dashboard HeaderadaptableId in Adaptable Options
FloatingPositionAdaptableCoordinatePosition of Dashboard when in Floating mode
IsCollapsedbooleanIs Dashboard collapsed; if true, header is visible (but not Tabs' contents)false
IsFloatingbooleanIs Dashboard floating; if true, appears in draggable, minmised form (double-click to revert to default position)false
IsHiddenbooleanWhether Dashboard is completely hidden - can be made visible again in Column Menu and Tool Panelfalse
ModuleButtonsAdaptableModuleButtonsButtons which open the Settings Panel screen for associated AdapTable Module['SettingsPanel']
PinnedToolbarsAdaptableDashboardToolbars | string[]Toolbars displayed above Grid (and not in Tab)
TabsDashboardTab[]Named group of ToolbarsEmpty Array

Dasboard Options

The Dashboard Options section contains some Dashboard configuration properties:

PropertyTypeDescriptionDefault
buttonsLocationDashboardButtonsLocationWhere in Dashboard to display Module and Custom Buttons'right'
canFloatbooleanWhether the Dashboard can be floated; if true (the default), double-clicking Dashboard puts it in float modetrue
customDashboardButtonsAdaptableButton<DashboardButtonContext>[]Custom Adaptable Buttons to appear in Dashboard
customToolbarsCustomToolbar[]Toolbars provided by Users which contain custom content
showQuickSearchInHeaderbooleanShows Quick Search input in Dashboard Headertrue

Dashboard API

The Dashboard API section provides access to all elements and configuration options in the Dashboard:

MethodReturnsDescription
collapseDashboard()voidCollapses Dashboard so only Dashboard Header is visible (and not Toolbars' contents)
dockDashboard()voidDocks Dashboard so it 'snaps back' into its customary position above the grid
expandDashboard()voidExpands Dashboard so Toolbars in Active Tab are fully visible
floatDashboard()voidFloats Dashboard so only Dashboard Header is visible (in reduced size); can be dragged to a new location
getActiveTab()DashboardTab | undefinedReturns current Active Tab (if there is one)
getActiveTabIndex()number | undefinedReturns current Active Tab index (if there is one)
getCurrentToolbars()AdaptableDashboardToolbars | string[]Retrieves all Toolbars in Active Tab
getCustomDashboardButtonByLabel(buttonLabel)AdaptableButton<DashboardButtonContext> | undefinedRetrieves first Custom Button with given Label
getCustomDashboardButtons()AdaptableButton<DashboardButtonContext>[]Retrieves all Custom Buttons
getCustomToolbarByName(customToolbarName)CustomToolbarReturns Custom Toolbar with the given name
getCustomToolbarHTMLElement(customToolbarName)HTMLElement | nullReturns 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()DashboardStateRetrieves Dashboard section from Adaptable State
getModuleButtons()AdaptableModuleButtonsRetrieves the Module Buttons in the Dashboard
getPinnedToolbars()AdaptableDashboardToolbars | string[]Retrieves pinned toolbars
getTabByName(tabName)DashboardTabRetrieves the Tab from State that matches inputted name
getTabs()DashboardTab[]Retrieves the Tabs in the Dashboard
hideDashboard()voidHides the Dashboard so cannot be seen
isDashboardCollapsed()booleanIs Dashboard Collapsed
isDashboardDocked()booleanIs Dashboard Docked
isDashboardExpanded()booleanIs Dashboard Expanded
isDashboardFloating()booleanIs Dashboard Floating
isDashboardHidden()booleanIs Dashboard Hidden
isDashboardVisible()booleanIs Dashboard Visible
isToolbarVisible(toolbar)booleanChecks if a given Toolbar is visible
openDashboardSettingsPanel()voidOpens Settings Panel with Dashboard section selected and visible
refreshDashboard()voidRefreshes 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)voidResets 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)voidSets Active Tab in Dashboard
setActiveTabIndex(tabIndex)voidSets Active Tab in Dashboard
setCustomToolbarHTMLContent(customToolbarName, htmlContent)voidRenders 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)voidSets title of Dashboard Header
setModuleButtons(moduleButtons)voidSets which Module Buttons are visible
setPinnedToolbars(toolbars)voidSets pinned toolbars
setTabs(Tabs)voidUpdates the Tabs in the Dashboard
showDashboard()voidMakes the Dashboard visible

AdapTable Events

There are 2 Adaptable Events which are fired by AdapTable related to the Dashboard:

Dashboard Changed Event

The Dashboard Changed Event fires when anything has changed in the Dashboard.

The DashboardChangedInfo object which is provided, includes the trigger for the Change and new and old versions of Dashboard State.

PropertyDescription
actionNameWhat caused Dashboard State to change
newDashboardStateCurrent Dashboard State
oldDashboardStatePrevious Dashboard State
isToolbarStateChangedToHidden(toolbarName)Check if given Toolbar was just changed to hidden state
isToolbarStateChangedToVisible(toolbarName)Check if given Toolbar was just changed to visible state

Custom Toolbar Configured Event

The Custom Toolbar Configured Event fires when the Configure button has been clicked in a Custom Toolbar.

The CustomToolbarConfiguredInfo simply provides the particular Custom Toolbar where the button was clicked:

PropertyTypeDescription
customToolbarCustomToolbarCustom Toolbar in which the 'Configure' button has been clicked
adaptableContextanyCustom application Context provided in AdaptableOptions.adaptableContext

Events Subscription

Subscribing to the Events is done the same as with all Adaptable Events:

api.eventApi.on('DashboardChanged', (eventInfo: DashboardChangedInfo) => {
});

api.eventApi.on('CustomToolbarConfigured', (eventInfo: CustomToolbarConfiguredInfo) => {
});