Row drag of one table (tableScope.rowDragService): drag handles (ColumnDefIf.rowDrag), pointer drag with ghost, drop marker and auto-scroll, the keyboard alternative (MOVE_ROW_UP / MOVE_ROW_DOWN) and the managed move. Use TableApi.moveRows, TableApi.isRowDragging and TableApi.cancelRowDrag instead.

Pointer Events (mouse, touch, pen) – only on the drag handle; its pointerdown is prevented, so the mouse handler of the table (range selection, column drag) never sees it.

Since

1.1.95

Hierarchy

  • RowDragService

Constructors

Accessors

Methods

  • Why a managed drag is not possible right now: "sorted" (a column has the sort state asc/desc), "filtered" (a filter hides rows), "cellFormulas" (moved rows would change the references of cell formulas, since 1.1.99) – undefined if it is possible or the drag is unmanaged.

    Returns undefined | "filtered" | "cellFormulas" | "sorted"

  • The dragged rows for a grabbed row: all rows with a selection if it is one of them (multiRow), else this one.

    Parameters

    • rowIndex: number

    Returns number[]

  • MOVE_ROW_UP / MOVE_ROW_DOWN: moves the focused row (or the selected rows, if it is one of them) one position. Trees: among the siblings.

    Parameters

    • direction: 1 | -1

      up or down

    Returns boolean

    true if the key was used (a row with a drag handle has the focus)

  • Moves rows in the model (managed), repaints, keeps focus and selection on the moved rows and announces the new position.

    Parameters

    • rowIndices: number[]

      display indices

    • target: RowDropTargetIf

      drop target

    • reselect: boolean = true

      select the moved rows again (multi-row drag)

    Returns number

    the new display index of the first moved row, -1 if nothing moved