Skip to content

Fix Grid Header Drag Proxy for Row Component Architecture #8975

@tobiu

Description

@tobiu

The current implementation of createDragProxy in src/draggable/grid/header/toolbar/SortZone.mjs is broken due to recent refactoring of the Grid component (specifically, the introduction of Neo.grid.Row).

Current Issues:

  1. Styling Loss: The drag proxy no longer retains the correct grid styling (e.g., even/odd row colors) because the proxy structure doesn't match the new row-based DOM structure.
  2. Height Calculation: The proxy height calculation might be incorrect or missing the necessary context.
  3. Data Retrieval: While cell content retrieval partly works for simple columns, it needs to be robustly adapted to fetch data from the new Row components.

Goal:

  • Update createDragProxy to correctly reconstruct the visual representation of the dragged column.
  • Ensure the proxy includes the full grid height and proper styling (mimicking the grid body).
  • Adapt the logic to iterate over Neo.grid.Row instances to extract cell VDOM.
  • Verify that component-based columns are handled gracefully (or at least don't crash, even if fully cloning them is complex).

Implementation Details:

  • Iterate over grid.body.items (the Row components) instead of body.getVdomRoot().cn.
  • Extract the specific cell VDOM matching the dragged column index from each Row.
  • Reconstruct the VDOM for the proxy to include neo-grid-row classes and styles to maintain visual fidelity during the drag operation.

Metadata

Metadata

Assignees

Labels

aibugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions