Skip to main content
Light Dark System

Nextmatch Action Controller

Et2NextmatchActionController Controller

Overview

Bridges Et2Nextmatch row rendering and selection state into the egw_action system so popup, drag, drop and placeholder actions can reuse the existing action implementations.

The controller owns action-manager registration, row action-object materialization, selection mirroring, context-menu execution, touch long-press handling and native drag/drop registration. Et2Nextmatch remains responsible for data loading and rendering; this class only adapts rendered rows to the legacy action framework.

Used by

These widgets create and host this controller.

Properties

Name Description Type Default
cancelLongPress Cancel any pending touch/pen long-press popup. - -
clearPreparedDragRow Native drag is armed on pointerdown and must be cleared again once the gesture completes or is canceled. - -
findActionTarget Resolve the action target row for drag/drop events. - -

Methods

Name Description Arguments
actionObjectsForRows() Action objects for the given (datastore) row ids, to hand to an action handler as its senders. Rows that have an action object already keep it. All others - rows the grid never rendered, eg. with “select all” - get a detached object, so a handler sees every selected row the same way. Those are not registered with the object manager: they only live as long as the handler holds on to them, and registering thousands of them would slow down every later selection change. rowIds: string[]
clearDropHover() Clear drag/drop hover classes from one row or the current hover row. rowElement: HTMLElement | null
clearRowActionObjects() Remove all row action objects and reset mirrored selection state. -
executeAction() Execute a registered action programmatically. Used by app code that already knows the action id and selection and does not need a context-menu action object. options.nmAction can temporarily force the legacy nextmatch action mode (submit, popup, etc.) for this execution without permanently changing the action definition. actionId: string, selection: { ids? : string[]; all? : boolean }, options: { nmAction? : string }
executePlaceholderAction() Execute one placeholder action immediately using Nextmatch default action handling. actionId: string, anchorElement: HTMLElement | null
getActionSubmitValue() Return the pending submit payload produced by the last submit action. Et2Nextmatch includes this value in its normal eTemplate submit value so server-side nextmatch actions receive the same fields as legacy Nextmatch. -
getInlinePlaceholderActions() Resolve inline placeholder actions from configured ids. If add has children, return the children entries instead of the add parent. -
getPlaceholderActionIds() Get currently configured placeholder action ids, including controller defaults. -
getSelection() Return a snapshot of the rows currently selected in the datagrid. Row ids are datagrid row ids. Callers that submit to the server should use the normalized provider ids produced by executeNextmatchAction(). -
handlePointerDown() Start touch/pen long-press detection and arm native mouse drag sources. event: PointerEvent
handlePointerMove() Cancel a pending long-press once the pointer moves beyond the threshold. event: PointerEvent
handleSelectionChanged() Mirror datagrid selection changes into the action framework. Explicitly selected rows remain materialized even when virtualization has recycled their DOM; select-all remains a global flag and does not create one action object per unloaded row. detail: { selectedRowIds? : string[]; activeRowId? : string; allSelected? : boolean }
handleShortcut() Execute an action shortcut originating in this nextmatch. This is called while the event is being captured by Et2Nextmatch. The datagrid consumes some keys (notably Ctrl+A) for its own navigation, so waiting for the document-level key manager would make those action shortcuts unreachable. event: KeyboardEvent
hasPlaceholderActions() Check whether the current action tree contains any configured placeholder actions. Final enabled/visible state is still evaluated by the action framework when the menu opens. -
hostConnected() No-op - setup is already fully lazy via ensureActionManagers(), triggered by initActions()/syncDragDropRegistration() rather than host connection. -
hostDisconnected() Release action objects, transient drag state and action-framework bindings. -
initActions() Register or update actions supplied by the server/template. Actions are attached to this Nextmatch’s action manager and annotated with data.nextmatch so existing app handlers can find the owning widget even when invoked through popup or drag/drop action implementations. actions: EgwAction[] | { [id : string] : object }
setDropHover() Mark a row as the current drag/drop hover target. rowElement: HTMLElement | null
setPlaceholderActions() Set placeholder action ids from legacy CSV string or array value. Empty input falls back to the default ["add"]. actionIds: string[] | string | null | undefined
syncDragDropRegistration() Register the rendered datagrid rows container with the action framework. This is called after render and when action links change so drag/drop handlers can resolve real row elements instead of the virtualized wrapper. -
triggerDefaultActionForRow() Execute the default row action, normally from double-click. contextEvent: Event
triggerPlaceholderPopup() Open the Nextmatch action popup for empty-state placeholder interactions. Placeholder actions are filtered to existing action ids (including first-level children) and executed through the regular EGroupware action system. contextEvent: Event, actionIds: string[], anchorElement: HTMLElement | null
triggerPopupForRow() Show the regular row action popup for a context-menu, keyboard or touch event. contextEvent: Event