Skip to content

refactor: Switch Grid Row to explicit updateContent pattern (#8964) #8972

@tobiu

Description

@tobiu

The current reactivity model for Neo.grid.Row using record_ and rowIndex_ reactive configs has proven brittle and prone to race conditions, update loops, and stale data (e.g., columns disappearing after scrolling).

Proposed Architecture:

  1. Remove Reactivity: Convert record_ and rowIndex_ to standard non-reactive configs in Neo.grid.Row.
  2. Explicit Update Method: Introduce updateContent({record, rowIndex}) in Neo.grid.Row.
    • This method will synchronously update the instance properties.
    • It will then explicitly trigger createVdom().
  3. Refactor GridBody:
    • Update createViewData to call row.updateContent() directly for every row in the view window.
    • Remove the force parameter logic as updateContent will always force a VDOM generation.
    • This simplifies the update logic and ensures determinism.

Tasks:

  1. Refactor src/grid/Row.mjs:
    • Change record_ to record.
    • Change rowIndex_ to rowIndex.
    • Remove afterSetRecord.
    • Implement updateContent(data).
  2. Refactor src/grid/Body.mjs:
    • Update createViewData to use item.updateContent({record, rowIndex}).
    • Remove force parameter usage.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions