Configuring Action Columns
Summary
- Action Columns are defined at Design Time in Action Column Options
- Each Column has identifiers, a
controlsarray, optionalsettings, and optionalrowScope
Defining Action Columns
Action Columns are provided in the actionColumns property of Action Column Options.
actionColumns
Developers define 4 main sets of information:
Identifiers
columnId— used internally when referencing the Column in Layouts and other objectsfriendlyName— used in the UI (falls back tocolumnId)
Controls
controls is an array of ActionColumnControl objects. Each item has a type (button, toggle, link, select, command, menu, form, or custom).
Deep Dive
Action Column Context
Settings
settings is an ActionColumnSettings object:
| Property | Purpose |
|---|---|
width | Fixed width in pixels (overrides autoWidth and minWidth) |
minWidth | Minimum width; also used as the width when autoWidth is false |
autoWidth | Estimates width from static Control labels/icons at setup time |
overflow | 'none' (default) or 'menu' — collapse overflowing Controls to "⋯" |
resizable | Whether the Column can be resized |
suppressMenu | Hide the Column header menu |
suppressMovable | Prevent dragging the Column |
Note
autoWidthuses static labels and icons only. Iflabeloriconare functions, setwidthexplicitly.- Layout
AutoSizeColumnsdoes not replace Action Column width calculation.
Row Scope
By default Controls appear in every row. Use rowScope to exclude grouped, summary or data rows.
Hint
Prefer the Control's hidden property when the decision is per-row rather than per-row-kind.
Putting it Together
Developer Guide
Defining an Action Column
AG Grid Column Definitions
In most cases Action Columns are not listed in AG Grid columnDefs.
AdapTable creates the AG Grid column from Action Column Options.
Sometimes a developer needs an AG Grid feature on that Column — a tooltip, or placing it inside a Column Group.
That is possible: add the Column to columnDefs with a Column Type of actionColumn. AdapTable wires it to the matching Action Column definition.
Hint
- Set the Column Type to
actionColumn - Make sure
colIdin the AG Grid ColDef andcolumnIdin the Action Column definition are the same value
Find Out More
See Adding Special Column Types for more details
- The AG Grid Column Group
Actionscontains 2 Action Columns - Both Columns were defined in AG Grid Column Defs with header and cell tooltips
- They use
type: ['actionColumn']so AdapTable can wire them up
Expand to see the AG Grid ColDef
- Hover over a Button in an Action Column and see the Tooltip which AG Grid provides
Grouped & Summary Rows
Use rowScope to hide Controls on grouped or summary rows.
rowScopeexcludes Grouped Rows and Summary Rows- The
Add StarControl appears only on data rows