View as Markdown

API reference: @salmonui/data-grid/engine/tree

treeCopyRowIdsfunction

import { treeCopyRowIds } from '@salmonui/data-grid/engine/tree';
function treeCopyRowIds(structure: TreeStructure, rowIds: readonly RowId[], mode: 'ancestors' | 'descendants' | 'both' | 'none'): RowId[];

The copied row ids widened by mode over the kept layout of the current query: ancestors adds every kept ancestor, descendants every kept descendant, both both, none nothing. The result is in tree pre-order without duplicates; ids that are not in the layout keep their relative order after the tree rows. O(n) over the kept rows.