Skip to content

Fix GridBody Column Position Sync on DataField Change #9195

@tobiu

Description

@tobiu

Objective

Fix a regression in Neo.grid.Body where changing a column's dataField at runtime (e.g., toggling between Total/Public/Private stats) desynchronizes the columnPositions map and Row recycling logic, causing rendering artifacts during horizontal scrolling.

Root Cause Analysis

  1. Stale columnPositions keys: The GridBody maintains a columnPositions collection keyed by dataField. When dataField changes on the column, the map key remains the old name, breaking lookups during updateMountedAndVisibleColumns.
  2. Stale oldCellMap keys: In Neo.grid.Row, the recycling logic uses oldCellMap keyed by dataField to find reusable DOM nodes. If the column's dataField changes but the VDOM nodes still have the old data-field attribute, recycling fails or misidentifies cells.

Tasks

  1. Sync columnPositions: Ensure that when a Column's dataField is updated, the GridBody's columnPositions map is updated to reflect the new key.
  2. Robust Recycling: Verify Row recycling logic can handle dataField transitions, possibly by forcing a full re-render (non-recycled) when column definitions change significantly.
  3. Verification: Verify that horizontal scrolling works seamlessly after a Data Mode switch in DevIndex.

Metadata

Metadata

Assignees

Labels

aibugSomething isn't workingcoreCore framework functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions