LearnNewsExamplesServices
Frontmatter
id9529
titleAdd lightweight cell resizing method to grid.Body
stateClosed
labels
enhancementaigrid
assigneestobiu
createdAtMar 20, 2026, 5:21 PM
updatedAtMar 20, 2026, 5:34 PM
githubUrlhttps://github.com/neomjs/neo/issues/9529
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[x] 9528 Real-time cell resizing during grid column drag:move
closedAtMar 20, 2026, 5:34 PM

Add lightweight cell resizing method to grid.Body

Closed v12.1.0 enhancementaigrid
tobiu
tobiu commented on Mar 20, 2026, 5:21 PM

Description

As a prerequisite for real-time grid cell resizing during a column drag (Issue #9528), we need a lightweight method in src/grid/Body.mjs to adjust cell widths and horizontal positions without causing a full row re-render.

Problem

Calling toolbar.passSizeToBody() on every drag:move tick triggers a full createViewData() cycle, destroying virtualization recycling benefits.

Solution

Implement updateCellPositions(dataField, newWidth) in src/grid/Body.mjs to:

  1. Update the columnPositions collection cache.
  2. Directly mutate the style.width of the resized column's cells in the VDOM.
  3. Directly mutate the style.left of all subsequent columns' cells in the VDOM.
  4. Update the scroll container's availableWidth.
  5. Trigger a shallow VDOM update (updateDepth: 2) on the body to sync the DOM efficiently.
tobiu added the enhancement label on Mar 20, 2026, 5:21 PM
tobiu added the ai label on Mar 20, 2026, 5:21 PM
tobiu added the grid label on Mar 20, 2026, 5:21 PM
tobiu assigned to @tobiu on Mar 20, 2026, 5:22 PM
tobiu marked this issue as blocking #9528 on Mar 20, 2026, 5:23 PM
tobiu referenced in commit 5b58f5e - "feat: Add lightweight cell resizing method to grid.Body (#9529)" on Mar 20, 2026, 5:28 PM
tobiu
tobiu Mar 20, 2026, 5:28 PM

Input from Gemini 3.1 Pro:

✦ I have implemented updateCellPositions inside src/grid/Body.mjs and hooked it into onDragMove in src/grid/header/plugin/Resizable.mjs using the shallow updateDepth: 2.

This directly adjusts the VDOM cell nodes without forcing full re-renders of the rows and avoiding toolbar.passSizeToBody() on every drag tick.

The changes have been pushed to the dev branch. Please review and verify the visual stability during a resize drag.

tobiu cross-referenced by #9528 on Mar 20, 2026, 5:33 PM
tobiu closed this issue on Mar 20, 2026, 5:34 PM