LearnNewsExamplesServices
Frontmatter
id9460
titleGrid: Column Drag & Drop Integration & State Transitions
stateClosed
labels
enhancementaigrid
assigneestobiu
createdAtMar 13, 2026, 11:28 AM
updatedAtMar 16, 2026, 1:27 PM
githubUrlhttps://github.com/neomjs/neo/issues/9460
authortobiu
commentsCount1
parentIssue9456
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 16, 2026, 1:27 PM

Grid: Column Drag & Drop Integration & State Transitions

Closed v12.1.0 enhancementaigrid
tobiu
tobiu commented on Mar 13, 2026, 11:28 AM

This is a sub-task of Epic #9456 (Buffered Grid - High-Performance Locked Columns).

Context: The Drag & Drop interface (SortZone) acts as an implicit state mutator for a column's locked property. If a user drags an unlocked column and drops it between two locked columns, it should adopt their locked state. Furthermore, changing a column's locked state at runtime fundamentally alters the layout of every row.

Task:

  1. DD State Inference: Update src/draggable/grid/header/toolbar/SortZone.mjs (switchItems / moveTo). When a column is dropped, infer its new locked state based on its immediate neighbors at the toIndex. Set the new locked state on the column.
  2. Runtime Updates: Implement afterSetLocked in src/grid/column/Base.mjs.
    • When the state changes, the column physically moves between the "Pooled" array and the "Permanent" array across all Row VDOMs.
    • Trigger a deep Grid body refresh (gridContainer.body.createViewData(false, true)) to cleanly rebuild the DOM architecture for the new state, leveraging the existing optimized recycling logic with force=true.
  3. Ensure the HeaderToolbar also updates to correctly reflect the .neo-locked-* classes on the header buttons.
tobiu added parent issue #9456 on Mar 13, 2026, 11:28 AM
tobiu added the enhancement label on Mar 13, 2026, 11:28 AM
tobiu added the grid label on Mar 13, 2026, 11:28 AM
tobiu added the ai label on Mar 13, 2026, 11:28 AM
tobiu assigned to @tobiu on Mar 13, 2026, 11:28 AM
tobiu referenced in commit 3880d23 - "Grid: Column Drag & Drop Integration & State Transitions (#9460)" on Mar 16, 2026, 1:22 PM
tobiu
tobiu Mar 16, 2026, 1:22 PM

Input from Gemini 3.1 Pro:

✦ I have completed the implementation for this sub-task (#9460).

Changes Implemented (SortZone.mjs):

  • Updated onDragEnd to infer the new locked state based on the surrounding columns.
  • The heuristic defaults to "unlocked" on boundaries, only assigning a lock state if the column is dropped squarely inside a locked zone or at the extreme outer edges.
  • Setting column.locked = newLocked inherently triggers grid.Container#onColumnLockChange, seamlessly triggering the deep architectural recalculation we built in #9483 without duplicating logic in SortZone.

This successfully wraps up the architectural phase of the Locked Columns Epic! I agree that testing and building examples should be handled in a fresh session to maintain clear context.

tobiu cross-referenced by #9456 on Mar 16, 2026, 1:25 PM
tobiu closed this issue on Mar 16, 2026, 1:27 PM