Documentation

@kanunilabs/datagrid-react


@kanunilabs/datagrid-react / moveRowInArray

Function: moveRowInArray()

moveRowInArray<TRow>(rows, dragKey, targetKey, position, keyOf): RowMoveResult<TRow>

Defined in: datagrid-core/dist/index.d.ts:4298

Move dragKey next to targetKey.

Returns the original array reference when nothing changes, so a caller can skip the recompute entirely — dropping a row back where it started should not cost a full pipeline pass.

Type Parameters

TRow

TRow = GridRowData

Parameters

rows

readonly TRow[]

dragKey

RowKey

targetKey

RowKey | null

position

RowDropPosition

keyOf

(row) => RowKey

Returns

RowMoveResult<TRow>