Column types

Supported column type keys, when to use each, and examples

The type field in $TBLColumns tells the frontend how to render a cell. Pick the type that matches your data — do not use html when text is enough.

Quick picker

Your data looks like…Use type
Plain string/numbertext
Long text, truncate in UItext_truncate
Key → label pairsdatalist or json_datalist
Clickable URLlink
true/falsebool
Row action buttons in gridaction
Rich HTML (rare)html
Image URLimage

Reference table

Type keyPHP classUse case
textTextTypeColumnNames, emails, IDs as text
text_truncateTextTrucateTypeColumnDescriptions, addresses
datalistDatalistTypeColumnStructured key/value in one cell
json_datalistJsonDatalistTypeColumnJSON column decoded to datalist
linkLinkTypeColumnInternal/external links
boolBooleanTypeColumnActive/inactive, yes/no
actionActionTypeColumnInline buttons in grid column
htmlHtmlTypeColumnPre-rendered HTML (sanitize carefully)
imageImageTypeColumnAbstractThumbnails, avatars

Examples

Text

['type' => 'text', 'label' => 'email', 'data_src' => 'email', 'sortable' => true],

Boolean with labels

[
    'type' => 'bool',
    'label' => 'is_active',
    'data_src' => 'is_active',
    'attributes' => [
        'values_formating' => [
            true => ['label' => 'Active', 'color' => 'green'],
            false => ['label' => 'Inactive', 'color' => 'gray'],
        ],
    ],
],
[
    'type' => 'link',
    'label' => 'order_number',
    'data_src' => 'number',
    'attributes' => [
        'linkText' => 'View order',
        'showCopyBtn' => true,
    ],
],

Datalist (status codes)

[
    'type' => 'datalist',
    'label' => 'metadata',
    'data_src' => 'meta',
    // uses formatDatalistColumnValue callback by default
],

Mobile visibility

'attributes' => ['showInMobileApp' => false],

Hides column on mobile clients while keeping it on web.

Action column vs row actions

action columnrowActions
PositionInside grid cellsRow menu / toolbar
DefinitionColumn in $TBLColumnssetRowActions()
Use whenAlways-visible inline buttonsStandard per-row menu

Most tables use rowActions only. Use action columns when buttons must align in a dedicated grid column.

On this page