View as Markdown

API reference: @salmonui/core/data

RowPlacementinterface

import type { RowPlacement } from '@salmonui/core/data';
interface RowPlacement {
    readonly rowIds: readonly RowId[];
    readonly targetRowId: RowId | null;
    readonly position: 'before' | 'after';
    readonly parentId?: RowId | null;
}

Moves rowIds (in this order) next to targetRowId; a null target means the start (before) or the end (after).

RowPlacement members (4)
NameSignatureDescription
rowIdsreadonly rowIds: readonly RowId[];
targetRowIdreadonly targetRowId: RowId | null;
positionreadonly position: 'before' | 'after';
parentIdoptionalreadonly parentId?: RowId | null;

Tree mode: the new parent of the moved rows (null: roots; absent outside tree mode). targetRowId / position stay a placement in the source array; the moved rows' subtrees travel with them, and flat (parentIdField) data also lists the rows whose parent changes in changed.