WarUI

Dependent (cascading) editor options computed from row values

GRID-UG-315-F01P1baselinePlanned

Lets dropdown and select editor options be a function of the current row, synchronous or async. Columns can declare a dependsOn list of other columns. When a parent value changes, the grid re-validates dependent values and clears or resets them according to a policy. This extends the dropdown editor (GRID-A14-F09) and the option-source behavior in GRID-A14-F11.

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

Live example

A 20-row address grid with columns Name, Country, State (dependsOn Country), and City (dependsOn State, options loaded async with a 500ms delay).

Expected behavior

The State dropdown lists only the selected country's states. Changing Country applies the chosen policy to State and then to City, cascading in order, and logs dependentValueReset. Async City options show a loading row in the editor. Cached options open instantly the second time. Pasting a new Country into a row applies the same policy.

Planned API surface

columnDef.editorOptions: Option[] | ((ctx: { row, column, api }) => Option[] | Promise<Option[]>)columnDef.dependsOn: string[] (column ids)columnDef.onDependencyChange: 'clear' | 'keepIfValid' | 'resetToFirst' | ((ctx) => newValue)columnDef.editorOptionsCacheKey?: (row) => stringEvent: dependentValueReset { rowId, colId, oldValue, newValue, cause }

Acceptance criteria

  • Options function receives the current, uncommitted row values when the editor opens (pending)
  • Async options show loading and error states in the editor, and stale responses are ignored (pending)
  • dependsOn cascades transitively in dependency order and detects cycles at configuration time (pending)
  • Policy applies for edits, paste, fill-handle and API value changes alike (pending)
  • Each automatic reset is undoable together with its triggering edit as one undo step (pending)