Column Grouping
Summary
- Column Groups are fully supported in AdapTable
- The Layout Wizard provides details of Column Groups and respects any Column Grouping rules
AdapTable fully supports AG Grid Column Grouping (sometimes known as column banding).
This is where multiple columns are placed in one group and given an additional, common Header.
- 3 Column Groups have been defined in
colDefsin Grid Options: Issues & PRs- contains
Open PRs,Closed PRs,Open IssuesandClosed IssuesColumns - has
marryChildrenset to true - so columns cannot be out of the Group Open IssuesandClosed IssuesColumns set withcolumnGroupShowas 'closed'
- contains
Dates- contains 3 Date Columns:
Updated,Pushed,Created - has
marryChildrenset to false - so columns can be out of the Group
- contains 3 Date Columns:
Details- contains
Description,License,Has Wiki,Has Projects&Has PagesColumns - has
marryChildrenset to true - so columns cannot be out of the Group - the
Descriptioncolumn hascolumnGroupShowset to 'closed'
- contains
Layouts
Column Groups are not specified in Layouts - as the GridOptions definition is sufficient.
But they are respected in Layouts.
For instance, in the Column list the Layout Editor displays the name of any Column Group a column belongs to.
It also prevents users moving columns out of Column Groups, where this is not allowed in the AG Grid definition.
Column Names
By default AdapTable will not change the FriendlyName of a Column when it is in a Column Group.
Note
The Friendly Name is how AdapTable refers to the Column e.g. in Wizards or Expression Editor
However sometimes the same Friendly Name can appear in multiple Column Groups (e.g. 3 columns groups each have a Bid and Ask column).
When this is the case, there are 2 ways to make the FriendlyName unique:
Adding Column Group Name
The simplest way to ensure uniqueness of FriendlyName for Columns in Column Groups is via the addColumnGroupToColumnFriendlyName property in Column Options.
This will append the name of the Column Group to the Friendly Name (e.g. "Bid [Bbg]", "Bid[Markit]").
Using a property
Use the columnFriendlyName property also in Column Options.
Find Out More
See the Developer Tutorial on Configuring Column Headers for more details
Special Columns
AdapTable provides 3 "Special Columns" which are created dynamically.
These can also be included in Column Groups, by providing these 2 steps:
- Add them explicitly in AG Grid Columns Defs (this is not normally required for Special Columns)
- Provide them with a Column Type of
calculatedColumn,freeTextColumnoractionColumn
- This example contains a Column Group (called 'Special Columns') which includes 3 Special Columns:
Big Stars- a Calculated ColumnAdd Issue- an Action ColumnComments- a FreeText Column
- All 3 columns were defined in Column Defs (as well as Adaptable Options / Initial Adaptable State)
- And all 3 columns were given a matching Column Type to wire it all up together