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

> The isAncestorOf function of @salmonui/data-grid/engine/tree: True when ancestor is a proper ancestor of row in layout (both source indexes). O(1).

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

```ts
import { isAncestorOf } 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 isAncestorOf(layout: TreeLayout, ancestor: number, row: number): boolean;
```

True when `ancestor` is a proper ancestor of `row` in `layout` (both source indexes). O(1).
