diff --git a/content/en/docs/4.guides/8.scopes.md b/content/en/docs/4.guides/8.scopes.md index fddc3010..f8461706 100644 --- a/content/en/docs/4.guides/8.scopes.md +++ b/content/en/docs/4.guides/8.scopes.md @@ -86,4 +86,14 @@ The ordering of nested nodes is a bit different as parent nodes shouldn't overla 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. +## Dynamically changing relationships + +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 + +```ts +// previously parent1.id was assigned +node1.parent = undefined; +await scopes.update(parent1.id) +``` + Check out the complete result on the [Scopes](/examples/scopes) example page. diff --git a/content/uk/docs/4.guides/8.scopes.md b/content/uk/docs/4.guides/8.scopes.md index 9b95703a..83c75d55 100644 --- a/content/uk/docs/4.guides/8.scopes.md +++ b/content/uk/docs/4.guides/8.scopes.md @@ -86,4 +86,14 @@ AreaExtensions.simpleNodesOrder(area); Той самий гайд [Упорядкування вузлів](/uk/docs/guides/arrange) можна використовувати для автоматичного позиціонування вузлів відносно один одного, оскільки плагін, який там використовується, також підтримує вкладені вузли. +## Динамічно змінені зв'язки + +Після того, як вузли були додані в редактор, щоб змінити з'вязки між візлами, окрім зміни `node.parent` вам потрібно явно викликати оновлення батьківського вузла + +```ts +// раніше був призначений parent1.id +node1.parent = undefined; +await scopes.update(parent1.id) +``` + Перегляньте повний результат на сторінці прикладу [Області видимості](/uk/examples/scopes).