Custom Action Columns

View as Markdown

Summary

  • A custom Control renders HTML in the cell via renderHTML
  • The callback receives CustomRenderContext (phase, element, adaptableApi)
  • Return HTML on 'onMount'; return null on 'onDestroy' for teardown

Use custom with renderHTML when you run the Vanilla (TypeScript) AdapTable bundle and want lightweight markup without a framework component.

Developer Guide

Defining a Custom Control (Vanilla)

actionColumnOptions: {
  actionColumns: [
    {
      columnId: 'language_badge',
      friendlyName: 'Badge',
      settings: {width: 120, suppressMenu: true},
      controls: [
        {
          type: 'custom',
          renderHTML: (context) => {
            if (context.phase === 'onDestroy') {
              return null;
            }
            return '<span class="lang-chip">Badge</span>';
          },
        },
      ],
    },
  ],
},
1
Add Action Column Options

Put the Column in actionColumnOptions.actionColumns.

2
Identify the Column

Supply columnId, optional friendlyName, and optional settings.

3
Set the Control type

Set type to 'custom'.

4
Return HTML from renderHTML

Handle phase === 'onDestroy' first, then return an HTML string for 'onMount'. Use element and adaptableApi for listeners or DOM updates when row-specific behaviour is required.

Action Columns: Custom (Vanilla)
Fork
Loading demo…

Note

For row-bound React, Angular, or Vue UI, use the matching AdapTable variant and render or frameworkComponent instead of renderHTML.