LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-julia
createdAtNov 3, 2026, 6:48 PM
updatedAtNov 3, 2026, 8:46 PM
githubUrlhttps://github.com/neomjs/neo/issues/20256
authorneo-opus-vega
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 3, 2026, 8:46 PM

A grid column config cannot name a column class from outside the engine

Closed v13.4.0/archive-v13-4-0-chunk-3 enhancementgood first issuedeveloper-experienceaigrid
neo-opus-vega
neo-opus-vega commented on Nov 3, 2026, 6:48 PM

Context

A grid column class that lives outside the engine, in an app or in a package that extends the grid, cannot be named in a grid's columns config. Neo.grid.Container#createColumns() picks every column's class from the static columnTypes map by type (src/grid/Container.mjs:1010). That map lists only the engine's own columns (:43).

The one way in today is a Container subclass that redeclares the map:

static columnTypes = {...GridContainer.columnTypes, myType: MyColumn}

No app or example does this: grep -rn columnTypes apps examples src hits src/grid/Container.mjs only. So a column shipped by a package can't be used in a consumer's existing grids without subclassing each of them.

Observed while building a tree-column subclass in a separate package. The column works, but only inside a dedicated Container subclass that registers its type.

The Problem

Everywhere else in Neo, a config names its class with module:

  • container items (src/container/Base.mjs:398);
  • ClassSystemUtil.beforeSetInstance();
  • the grid's own body: {module: MyBody}.

Columns are the exception, so the engine's built-in columns are the only ones a config can reach.

The Architectural Reality

createColumns() (src/grid/Container.mjs:952) builds two things from each column config:

  1. The header button. buttonConfig = {...column, columnMenu: …} (:993) loses only id (:996) and becomes an item of the header toolbar. The toolbar's itemDefaults is {ntype: 'grid-header-button'} (src/grid/header/Toolbar.mjs:37).
  2. The column. columnClass = me.constructor.columnTypes[column.type || 'column'] (:1010), then Neo.create(columnClass, {parent, windowId, ...column}) (:1013).

The trap. In container item creation, an item's module deletes the ntype default (src/container/Base.mjs:396-400). So a module copied into buttonConfig would build the column class as a header button.

The Fix

In createColumns():

  1. A column config's module, a class extending Neo.grid.column.Base, takes precedence over type: columnClass = column.module || columnTypes[column.type || 'column'].
  2. module never reaches the header button. Delete it from buttonConfig beside id, and from the column config once it is consumed, as type already is.
  3. The JSDoc of columns_ and columnTypes names both ways to choose a column class.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Neo.grid.Container#columns_ column configs createColumns(), src/grid/Container.mjs:952 A config may carry module: <column class>, which wins over type No module: today's type lookup, default 'column' JSDoc of columns_ and columnTypes New unit spec

Decision Record impact: none.

Acceptance Criteria

  • A column config {module: MyColumn, dataField: 'x'} creates a MyColumn. MyColumn is defined in the spec, extends Neo.grid.column.Base and is absent from columnTypes.
  • That column's header button is a Neo.grid.header.Button, not a MyColumn.
  • Without module, type resolves exactly as today, and the existing grid unit specs stay green.
  • Setting columns again keeps module-based columns working.
  • A unit spec in test/playwright/unit/grid/ covers these cases, run with npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/grid/.

Out of Scope

  • A global registration API such as Container.registerColumnType(). Mutating a shared static map on import changes every grid in the app; module stays local to the config that names it.
  • Neo.table.Container. It has no columnTypes map.
  • Replacing the header button's class.

Avoided Traps

  • Spreading module into buttonConfig. It builds the column class as a header button (see the trap above).
  • The status quo, a Container subclass per grid that uses an extension column.

Related

  • #9035, #9009: engine columns were registered by editing the map in src/grid/Container.mjs.

Live latest-open + closed sweep: checked latest 20 open + closed search (columnTypes, custom column, column type) at 2026-11-03T17:5xZ. Out of Scope / Avoided Traps were read on the same-surface hits #6525, #9009 and #9035; no equivalent or prior exclusion found. KB ticket sweep: no equivalent. A2A sweep, last 30 messages: no claim on this scope. Memory Core: no prior decision. Own assignments: none on this surface.

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Origin Session ID: 9ae27458-df2a-4524-94e3-65fb2a075f3d

Retrieval Hint: "grid column config module class outside columnTypes"

tobiu referenced in commit 03b8f03 - "feat(grid): allow column configs to name a column class via module (#20256) (#20261)" on Nov 3, 2026, 8:46 PM
tobiu closed this issue on Nov 3, 2026, 8:46 PM