# parentsFromIds (@salmonui/data-grid/engine/tree)

> The parentsFromIds function of @salmonui/data-grid/engine/tree: Parents of flat self-referential rows. parentIdOf(i) returns row i's parent id (null for a root); indexOf resolves an id to a source index (-1 when unknown, through the engine id index). Unknown ids make the row an orphan root; a parent chain that loops is broken at the first repeated row, which becomes a root.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine-tree/parentsFromIds

```ts
import { parentsFromIds } from '@salmonui/data-grid/engine/tree';
```

Entry index: https://salmonui.dev/docs/reference/data-grid/engine-tree (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine-tree.md).

## Reference

Kind: function

```ts
function parentsFromIds(count: number, parentIdOf: (index: number) => string | null, indexOf: (id: string) => number, onIssue?: (issue: TreeIssue) => void): Int32Array;
```

Parents of flat self-referential rows. `parentIdOf(i)` returns row `i`'s
parent id (null for a root); `indexOf` resolves an id to a source index
(-1 when unknown, through the engine id index). Unknown ids make the row an
orphan root; a parent chain that loops is broken at the first repeated row,
which becomes a root.
