WarUI

Cancelable Before-Events

GRID-A26-F03P0baselinePlanned

Paired 'before' events (for example beforeSortChange and beforeCellEdit) let handlers veto or modify an action before it is applied. Applications can enforce business rules without forking grid behaviour.

Planned. This page shows the specification from issue #206. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

A grid in which some rows are flagged as locked. A beforeCellEdit handler rejects edits on locked rows.

Expected behavior

A vetoed edit never opens the editor and shows an inline hint. When the user rejects the confirmation, the sort order stays the same. A vetoed action does not emit the matching 'after' event.

Planned API surface

beforeSortChangebeforeFilterChangebeforeCellEditbeforeRowDropevent.preventDefaultevent.defaultPreventedasyncVeto

Acceptance criteria

  • preventDefault() stops the action, and the matching after-event is not emitted (pending)
  • A handler may replace the payload value, for example to coerce a sort direction (pending)
  • An async veto that resolves to false cancels the action (pending)
  • A handler that never resolves is treated as allowed after a configurable timeout (pending)