Columns overview
How API column definitions become react-data-table-component columns
Columns are defined in the control table structure (structureColumns in tableCore). The UI never hardcodes column lists for production tables.
Pipeline
File: ./ApiTables/table-utils/utils.tsx — formatTableColumns(cols, tbData)
Column definition fields (from API)
| Field | Role |
|---|---|
label | Header text |
data_src | Row field key |
type | Renderer selector (see Column types) |
sortable | Enables server sort on header click |
showable | If false, column excluded from table |
values_formating | Badges / boolean labels (API spelling) |
linkStyle, linkText, linkColor, showCopyBtn | For link type |
Visibility
ColumnsVisibility filters formatted columns against visibleColumns. Toggle persists:
secure LS key: {tableName}_tbWidth calculation
- Non-link, non-barcode:
calculateColMinWidthfrom longest cell indata_src+ header label (cap ~500px) link,barcode: fixed ~250px- After each fetch,
useTableFetchermay update widths withcalculateMinWidthper row content
Actions column
Type actions renders TableRowActions when row.actions has keys. Structure may instead place actions under each column name (actionsInRegularCells).
Column modals (non-action)
Types html and datalist / dataList open modals via _setRowSelectedModal — routed in ./ApiTables/table-modals/ColumnsStaticModals.tsx inside ./ApiTables/table-modals/ApiTablesModals.tsx.