Skip to Content

ListingActions

Renders the action buttons for a single entity row. The buttons shown are driven by the enabledActions array from ListingContext. The component also handles modals for delete confirmation, quick-edit, quick-show, quick-duplicate, and default-value flagging.

On desktop the buttons are shown inline; on mobile they collapse into a DropdownMenu. When a row is selected for bulk editing or inline editing, the buttons are replaced with a Cancel / Update pair.


Import

import ListingActions from "@phpcreation/frontend-crud-react-nextjs-bundle/components/Listing/Actions";

Props

PropTypeRequiredDescription
fqcn_buiIFQCN_BUIYesUsed to generate stable element IDs.
resourcestringYesAPI resource name, e.g. "invoices".
idnumberYesEntity ID for this row.
formInputsEditFilterField[]NoFields for quick-edit modal.
formInputsAddFilterField[]NoFields for quick-duplicate modal.
formInputsShowFilterField[]NoFields for quick-show modal.
isKanbanbooleanNoSwitches to compact Kanban button style.
localestringNoActive locale, defaults to "en".
userUser | nullYesUsed for role-based action visibility via getRoleAccessbility.
tenantstringYesTenant identifier.
customActions{ key: string; action: ReactNode }[]NoOverride or extend specific action slots.
qFieldstringNoQuery field name used in translatable entity flows.
defaultFlagkvsanyNoKVS hook result for the default-value flag feature.
translatablebooleanNoEnables translation handling in quick-edit/duplicate.

Supported Action Keys

The enabledActions string array (set in ListingContext) accepts these keys:

KeyDescription
"show"Navigate to the entity detail page.
"quick-show"Open a read-only modal preview.
"edit"Navigate to the full edit page.
"quick-edit"Open an in-context edit modal.
"inline-edit"Enable inline field editing in the table row.
"duplicate"Navigate to the create page pre-filled with this row’s data.
"quick-duplicate"Open a quick-duplicate modal.
"delete"Open delete confirmation modal.
"disable"Toggle the entity’s disabled/disabledAt field.
"priority-up"Swap priority with the previous row. Flat listing only, hidden on the treeview route.
"priority-down"Swap priority with the next row. Flat listing only.
"tree-up"Swap lft/rgt with the previous same-parent sibling. Treeview route only.
"tree-down"Swap lft/rgt with the next same-parent sibling. Treeview route only.
"default-value"Mark entity as the default value via KVS.
"anchor"Copy a direct link to this row to the clipboard.
"email-template"Delegates to ActionButtons for email template actions.
"print-template"Delegates to ActionButtons for print template actions.

Role-based access is checked per action via getRoleAccessbility(user?.roles, resource, action). Actions the user lacks permission for are hidden entirely, not just disabled.

The priority and tree move buttons use the same chevron icons but reorder different things; see Tree View for the comparison.


Usage

// enabledActions is set on ListingContext; ListingTable passes these props automatically. <ListingActions fqcn_bui={{ Bundle: "BillBundle", Unit: "Invoice", Interface: "listing" }} resource="invoices" id={item.id} formInputsEdit={editFields} formInputsAdd={addFields} formInputsShow={showFields} user={currentUser} tenant="acme" locale="en" />

Last updated on