Tool Panel Technical Reference

View as Markdown

Tool Panel State

ToolPanelState

Tool Panel section of Adaptable State, including Initial State.

ToolPanels is the list of panels and whether each is expanded or collapsed. When it is omitted, AdapTable shows a collapsed panel for every module and for every custom tool panel. ModuleButtons are the shortcut buttons in the tool panel; the default is an empty list.

Extends

BaseState

ModuleButtons?

AdaptableModuleButtons

AdapTable Module Buttons visible in ToolPanel

Default

Empty Array

Tool panels to show, and whether each is expanded or collapsed.

When omitted, every module and every custom tool panel is included, collapsed.

AdaptableToolPanelDefinition

One tool panel.

Name is an AdapTable module or a custom panel from Tool Panel Options. VisibilityMode is 'expanded' (the panel body is open) or 'collapsed' (only the header is shown). The default is 'collapsed'.

ToolPanel name - either an Adaptable Module or a Custom ToolPanel (defined in ToolPanel Options)

VisibilityMode?

'expanded' | 'collapsed'

'expanded' shows the panel body. 'collapsed' shows only the header.

Default

'collapsed'

Name is an AdaptableToolPanel:

Value
'Alert'
'BulkUpdate'
'CellSummary'
'Charting'
'Dashboard'
'DataChangeHistory'
'Export'
'ColumnFilter'
'GridFilter'
'IPushPull'
'Layout'
'Note'
'OpenFin'
'QuickSearch'
'SmartEdit'
'StateManagement'
'SystemStatus'
'Theme'

Tool Panel Options

Custom Buttons

customButtons is a list of AdaptableButton objects. The click handler receives a ToolPanelButtonContext.

AdaptableButton

A button on a form, alert or toolbar.

label is the text. onClick runs when it is clicked and receives the button and the form or event context. buttonStyle and icon are optional. disabled and hidden are functions that return whether the button is disabled or hidden.

buttonStyle?

ButtonStyle| ((button:AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) =>ButtonStyle)

Style for Button - can be object or function that provides a ButtonStyle object

disabled?

(button:AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean

Function that disables / enables the button based on its evaluation result

hidden?

(button:AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean

Function which sets whether Button is hidden

icon?

AdaptableIcon| ((button:AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) =>AdaptableIcon)

Icon for Button - can be object or function that provides a AdaptableIcon object

iconPosition?

'start' | 'end'

Where the icon appears relative to the label

Default

'start'

label?

string | ((button:AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => string)

Label for Button - can be string or function that provides string

onClick?

(button:AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => void

Function to invoke when button is clicked

tooltip?

string | ((button:AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => string)

Tooltip for Button - can be string or function that provides string

buttonStyle is a ButtonStyle:

ButtonStyle

Appearance of an AdapTable button.

variant is 'text', 'outlined' (the default) or 'raised'. tone is the colour: 'neutral' (the default), 'success', 'error', 'warning', 'info', 'accent' or 'none'. className adds a CSS class.

className?

string

CSS Classname to use for the Button

tone?

'success' | 'error' | 'neutral' | 'none' | 'warning' | 'info' | 'accent'

Button's Tone - values: 'success', 'error', 'neutral', 'none', 'warning', 'info', 'accent'

Default

'neutral'

variant?

'text' | 'outlined' | 'raised'

How Button appears - values: 'text', 'outlined', 'raised'

Default

'outlined'

Custom Tool Panels

CustomToolPanel

Defines a Custom ToolPanel - provided by Users and contains custom content

Optional set of buttons to show in the ToolPanel

Framework-specific (Angular, React or Vue) component to be rendered

name

string

Name of Custom ToolPanel - should be unique

render?

(customRenderContext:CustomRenderContext) => string | null

Function to provide bespoke content when using AdapTable Vanilla

title?

string

Title to display in Custom ToolPanel; if undefined, will default to name property

buttons is a list of AdapTable Buttons. The click handler receives a CustomToolPanelButtonContext:


Tool Panel API

ToolPanelApi

Functions for managing the AdapTable ToolPanel Component (at side of grid)

Closes the Tool Panel section (irrespective of which toolpanel is showing)

Retrieves all Custom Tool Panel Buttons defined in ToolPanelOptions

Retrieves the CustomToolPanel with the given name (or undefined if no match is found)

Retrieves all Custom Tool Panels defined in ToolPanelOptions

getModuleButtons()
returns

AdaptableModuleButtons

The module buttons currently shown in the AdapTable tool panel.

Retrieves Tool Panel section from Tool Panel State

Opens the Adaptable ToolPanel Component

Expands or collapses one of the AdapTable tool panels.

Expands or collapses a custom tool panel.

Sets the Module buttons in the Adaptable ToolPanel

Opens Settings Panel with Tool Panel section selected and visible