Configuring the Tool Panel
Summary
- This tutorial describes the options available when setting up the AdapTable Tool Panel Component
- A default implementation is available suitable for most use cases
- Developers can provide a bespoke implementation in GridOptions if required
Setting up Tool Panel Component
Note
- Previously AdapTable Angular and React directly referenced the AdapTable Tool Panel Component
- Since Version 12 of AdapTable this is no longer required
There are 3 options available when configuring the sideBar property in AG Grid GridOptions:
SideBar is set to true
This is the most straightforward and uses the default AG Grid and AdapTable settings:
gridOptions.sideBar = trueWhen directly referenced is set to true, 2 things will happen:
- AG Grid will provide the
FiltersandColumnsToolPanels - AdapTable will append the
AdapTableTool Panel
Deep Dive
What does AdapTable create when sideBar is true?
List of ToolPanels
A slightly more bespoke alternative is to list which ToolPanels are required:
gridOptions.sideBar =['adaptable', 'filters']When the user provides a list of ToolPanels, the following happens:
- AG Grid will create any AG Grid ToolPanels named in the list
- AdapTable will create the AdapTable Tool Panel (assuming that 'adaptable' is in the list)
- The ToolPanels will display in the order provided
Customised Sidebar
For more advanced scenarios a fully, customised Sidebar can be provided in AG Grid GridOptions.
gridOptions.sideBar ={
toolPanels: [
'filters',
{
id: 'adaptable', // never change this
toolPanel: 'AdaptableToolPanel', // never change this
labelDefault: 'AdapTable',
iconKey: 'menu',
width: 200,
minWidth: 200,
maxWidth: 300,
}
],
defaultToolPanel = 'adaptable',
position: 'left';
}In this scenario:
- the Tool Panels will display in the order provided
- The Adapable Tool Panel Component will be configured bsed on the properties provided
Caution
- Make sure that the values for the
idandtoolPanelproperties are not changed - They should remain as 'adaptable' and 'AdaptableToolPanel' respectively
Hiding AdapTable Tool Panel
It is possible to hide the AdapTable Tool Panel but still display one or more of the AG Grid Tool Panels (and / or to provide a custom one).
Hint
To hide the Side Bar altogether simply leave out the sideBar property in AG Grid GridOptions
There are 2 ways to hide the AdapTable Tool Panel:
- setting the Module Entitlement for Tool Panel to
Hidden - leave out
adaptablefrom the list of Tool Panels - e.g. setting:gridOptions.sideBar =['columns', 'filters']
Note
If the Entitlement is set to hidden, the AdapTable Tool Panel will not display even if its provided by name
Hiding ToolPanels Dropdown
Option not to display the Tool Panels available at the top of the AdapTable Tool Panel Component.
showToolPanelsDropdown
Default: trueboolean