Function moveTreeRows

  • Moves tree rows in place: in front of / behind targetRow (siblings, same parent) or "inside" it (last children; the target is expanded). Children travel with their parent; parent and deep are updated.

    Type Parameters

    • S

    Parameters

    • roots: TreeRowIf<S>[]

      the top-level rows (e.g. AreaModelTree.rows)

    • rows: readonly TreeRowIf<S>[]

      dragged rows in display order

    • targetRow: TreeRowIf<S>

      the row under the drop marker

    • position: RowDropPosition

      where to drop

    Returns boolean

    false if nothing was moved (cycle, no rows)

    Example

    const treeModel = tableModel.getBodyModel() as AreaModelTree<OrderNode>;
    moveTreeRows(treeModel.rows, [treeModel.rows[2]], treeModel.rows[0], "inside"); // 3rd root → child of the 1st
    treeModel.recalcVisibleTreeRows();

    Since

    1.1.95