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:

PropertyDescriptionDefault
ActiveTabIndexIndex of Active Tab (in Tabs collection)
DashboardTitleTitle displayed in Dashboard HeaderadaptableId in Adaptable Options
FloatingPositionPosition of Dashboard when in Floating mode
IsCollapsedIs Dashboard collapsed; if true, header is visible (but not Tabs' contents)false
IsFloatingIs Dashboard floating; if true, appears in draggable, minmised form (double-click to revert to default position)false
IsHiddenWhether Dashboard is completely hidden - can be made visible again in Column Menu and Tool Panelfalse
IsInlineAlternative way of rendering Dashboard, with headers section to left of Toolbarsfalse
ModuleButtonsButtons which open the Settings Panel screen for associated AdapTable Module['SettingsPanel']
PinnedToolbarsToolbars displayed above Grid (and not in Tab)
TabsNamed group of ToolbarsEmpty Array

Dasboard Options

The Dashboard Options section contains some Dashboard configuration properties:

PropertyDescriptionDefault
buttonsLocationWhere in Dashboard to display Module and Custom Buttons'right'
canFloatWhether the Dashboard can be floated; if true (the default), double-clicking Dashboard puts it in float modetrue
customDashboardButtonsCustom Adaptable Buttons to appear in Dashboard (alongside Module Buttons)
customToolbarsToolbars provided by Users which contain custom content
showQuickSearchInHeaderShows Quick Search textbox in the Dashboard Headertrue

Dashboard API

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

MethodDescription
collapseDashboard()Collapses Dashboard so only Dashboard Header is visible (and not Toolbars' contents)
dockDashboard()Docks Dashboard so it 'snaps back' into its customary position above the grid
expandDashboard()Expands Dashboard so Toolbars in Active Tab are fully visible
floatDashboard()Floats Dashboard so only Dashboard Header is visible (in reduced size); can be dragged to a new location
getActiveTab()Returns current Active Tab (if there is one)
getActiveTabIndex()Returns current Active Tab index (if there is one)
getCurrentToolbars()Retrieves all Toolbars in Active Tab
getCustomDashboardButtonByLabel(buttonLabel)Retrieves first Custom Button with given Label
getCustomDashboardButtons()Retrieves all Custom Buttons
getCustomToolbarByName(customToolbarName)Returns Custom Toolbar with the given name
getCustomToolbarHTMLElement(customToolbarName)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()Retrieves all Custom Toolbars
getDashboardState()Retrieves Dashboard section from Adaptable State
getModuleButtons()Retrieves the Module Buttons in the Dashboard
getPinnedToolbars()Retrieves pinned toolbars
getTabByName(tabName)Retrieves the Tab from State that matches inputted name
getTabs()Retrieves the Tabs in the Dashboard
hideDashboard()Hides the Dashboard so cannot be seen
isDashboardCollapsed()Is Dashboard Collapsed
isDashboardDocked()Is Dashboard Docked
isDashboardExpanded()Is Dashboard Expanded
isDashboardFloating()Is Dashboard Floating
isDashboardHidden()Is Dashboard Hidden
isDashboardVisible()Is Dashboard Visible
isToolbarVisible(toolbar)Checks if a given Toolbar is visible
openDashboardSettingsPanel()Opens Settings Panel with Dashboard section selected and visible
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
setActiveTab(tabName)Sets Active Tab in Dashboard
setActiveTabIndex(tabIndex)Sets Active Tab in Dashboard
setCustomToolbarHTMLContent(customToolbarName, htmlContent)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)Sets title of Dashboard Header
setModuleButtons(moduleButtons)Sets which Module Buttons are visible
setPinnedToolbars(toolbars)Sets pinned toolbars
setTabs(Tabs)Updates the Tabs in the Dashboard
showDashboard()Makes 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:

PropertyDescription
customToolbarCustom Toolbar in which the 'Configure' button has been clicked
adaptableContextCustom 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) => {
});