Configuring Action Columns

View as Markdown

Summary

  • Action Columns are defined at Design Time in Action Column Options
  • Each Column has identifiers, a controls array, optional settings, and optional rowScope

Defining Action Columns

Action Columns are provided in the actionColumns property of Action Column Options.

actionColumns

Columns which contain interactive Controls used for performing Actions

Developers define 4 main sets of information:

Identifiers

  • columnId — used internally when referencing the Column in Layouts and other objects
  • friendlyName — used in the UI (falls back to columnId)

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:

PropertyPurpose
widthFixed width in pixels (overrides autoWidth and minWidth)
minWidthMinimum width; also used as the width when autoWidth is false
autoWidthEstimates width from static Control labels/icons at setup time
overflow'none' (default) or 'menu' — collapse overflowing Controls to "⋯"
resizableWhether the Column can be resized
suppressMenuHide the Column header menu
suppressMovablePrevent dragging the Column

Note

  • autoWidth uses static labels and icons only. If label or icon are functions, set width explicitly.
  • Layout AutoSizeColumns does 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 colId in the AG Grid ColDef and columnId in the Action Column definition are the same value

Find Out More

See Adding Special Column Types for more details

Action Columns: Defining in AG Grid
Fork
  • The AG Grid Column Group Actions contains 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

Try It Out
  • Hover over a Button in an Action Column and see the Tooltip which AG Grid provides
Loading demo…

Grouped & Summary Rows

Use rowScope to hide Controls on grouped or summary rows.

Action Columns: Grouped Rows
Fork
  • rowScope excludes Grouped Rows and Summary Rows
  • The Add Star Control appears only on data rows

Expand to see the Action Column Definition

Loading demo…