Skip to content

Commit 42d8ee9

Browse files
authored
Merge pull request #159 from retejs/scopes-docs
feat(docs): update sopes duynamic relationships
2 parents f8876e5 + ea00eea commit 42d8ee9

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

content/en/docs/4.guides/8.scopes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,14 @@ The ordering of nested nodes is a bit different as parent nodes shouldn't overla
8686

8787
The same [Arrange nodes](/docs/guides/arrange) guide can be used for automated positioning of nodes in relation to one another, as the plugin used within also supports nested nodes.
8888

89+
## Dynamically changing relationships
90+
91+
After the nodes have been added to the editor, to change the bindings between nodes, in addition to changing `node.parent` you need to explicitly call the update method
92+
93+
```ts
94+
// previously parent1.id was assigned
95+
node1.parent = undefined;
96+
await scopes.update(parent1.id)
97+
```
98+
8999
Check out the complete result on the [Scopes](/examples/scopes) example page.

content/uk/docs/4.guides/8.scopes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,14 @@ AreaExtensions.simpleNodesOrder(area);
8686

8787
Той самий гайд [Упорядкування вузлів](/uk/docs/guides/arrange) можна використовувати для автоматичного позиціонування вузлів відносно один одного, оскільки плагін, який там використовується, також підтримує вкладені вузли.
8888

89+
## Динамічно змінені зв'язки
90+
91+
Після того, як вузли були додані в редактор, щоб змінити з'вязки між візлами, окрім зміни `node.parent` вам потрібно явно викликати оновлення батьківського вузла
92+
93+
```ts
94+
// раніше був призначений parent1.id
95+
node1.parent = undefined;
96+
await scopes.update(parent1.id)
97+
```
98+
8999
Перегляньте повний результат на сторінці прикладу [Області видимості](/uk/examples/scopes).

0 commit comments

Comments
 (0)