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/number | text |
| Long text, truncate in UI | text_truncate |
| Key → label pairs | datalist or json_datalist |
| Clickable URL | link |
| true/false | bool |
| Row action buttons in grid | action |
| Rich HTML (rare) | html |
| Image URL | image |
Reference table
| Type key | PHP class | Use case |
|---|---|---|
text | TextTypeColumn | Names, emails, IDs as text |
text_truncate | TextTrucateTypeColumn | Descriptions, addresses |
datalist | DatalistTypeColumn | Structured key/value in one cell |
json_datalist | JsonDatalistTypeColumn | JSON column decoded to datalist |
link | LinkTypeColumn | Internal/external links |
bool | BooleanTypeColumn | Active/inactive, yes/no |
action | ActionTypeColumn | Inline buttons in grid column |
html | HtmlTypeColumn | Pre-rendered HTML (sanitize carefully) |
image | ImageTypeColumnAbstract | Thumbnails, 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'],
],
],
],Link
[
'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 column | rowActions | |
|---|---|---|
| Position | Inside grid cells | Row menu / toolbar |
| Definition | Column in $TBLColumns | setRowActions() |
| Use when | Always-visible inline buttons | Standard per-row menu |
Most tables use rowActions only. Use action columns when buttons must align in a dedicated grid column.
Related
- Columns overview
- Frontend mirror: column types in the UI docs