// Set a node's parent or an edge's endpoints without changing its id or data
eles.move(opts: { source?: string; target?: string; parent?: string | null; }): thisSet a node's parent or an edge's endpoints without changing its id or data.
Use { parent: id } to reparent nodes, or { parent: null } to make them orphans. Use { source: id, target: id } to rewire edges. If parent is present it takes precedence over endpoint keys. A changed parent emits a moveout event before the change and move afterwards.
An unknown parent is ignored. Cyclic parent assignments warn and are ignored.
| Name | Description |
|---|---|
opts: { source?: string; target?: string; parent?: string | null; } |
|
Fields of opts
| Name | Description |
|---|---|
source: string? | |
target: string? | |
parent: string | null? |
thisthis collection, for chaining
Example
cy.getElementById('ab').move({ target: 'c' });console.log(cy.getElementById('ab').target().id()); // 'c'