Row action types
action_type values and their UI behavior
Defined in structure and echoed on each row.actions entry. Rendered in ./ApiTables/general-components/RowActionsElements.tsx.
action_type reference
| action_type | Component | Behavior |
|---|---|---|
toggle | ToggleRowActionElement | Switch UI; POST on change; modal if need_confirmation |
redirect | RedirectRowActionElement | Internal Next.js Link to redirect_routes.api |
external_redirect | ExternalRedirectRowActionElement | <a target="_blank"> |
copy | CopyRowActionElement | copyToClipboard(copy_value) |
| (default) | GeneralRowActionElement | POST to action.api; loading state per row id |
custom_control | GeneralRowActionElement | POST + onSuccess: OpenModalForm → custom popup |
General / custom_control POST
rowActionsPostHandler(
action.method,
action.action.api.replace('/api', ''),
{ /* row id or selected_ids */ },
action,
customHeader?
);For bulk-style row actions (isBulk on action), payload uses selected_ids from tableColumns.selectedIds.
Toggle specifics
- Uses
action.toggle_current_valuefor controlled switch state - Bulk variant passes
isBulk: trueand selected ids
Redirect specifics
redirectuses i18n-awareLinkfrom@/i18n/navigationexternal_redirectdoes not use locale routing
Copy specifics
Uses copyToClipboard with optional toast (default Arabic success message in util).
Backend fields commonly used
| Field | Purpose |
|---|---|
button.label | Visible label |
method | HTTP method |
action.api / action.web | Endpoint |
need_confirmation | Opens ConfirmationModal |
onSuccess | Post-action strategy (see modals doc) |
applicableAsBulkAction | Eligible in selection toolbar |
action_key | Special cases (exports, etc.) |