butterfly Missing function Group.addGroup / Group.addGroups

rvpgvaaj  于 5个月前  发布在  其他
关注(0)|答案(9)|浏览(59)

What problem does this feature solve?

The API allows us to manually add nodes to a group by using group.addNodes(nodes).

However, i can't find any function to add a subgroup to a group although the feature is supported (see includeGroups ). I'd expect that there's a function like group.addGroups(groups) .

Do i miss something?

icnyk63a

icnyk63a1#

I will support as soon as possible

vjrehmav

vjrehmav2#

I think you should call canvas.addGroup , but not Group.addGroups .

sqougxex

sqougxex3#

But canvas.addGroup would add a new group to the canvas. That's not what i want to do.

I just want to change the parent of a group that already exist.
Afterwards the subgroup should me moved when the parent group is moved.

uyto3xhc

uyto3xhc4#

canvas.addGroup({
  id: 'xxx',
  group: 'xxx' // you can pass group id
})
zpjtge22

zpjtge225#

@noonnightstorm

Your code sample would create anewsubgroup, right?
I'd like to turn an existing group into a subgroup.

Edited:
I tried your code snippet. It doesn't work.
I think the functions Group.addGroups and Group.removeGroups are really missing.

t9eec4r0

t9eec4r06#

Maybe you can canvas.removeGroups and canvas.addGroups .

g52tjvyc

g52tjvyc7#

I already tried it but it does not work.

When i use canvas.removeGroups and canvas.addGroups the nodes won't be part of the group anymore.
That means that the nodes of the group don't move when i move the group itself.

o2gm4chl

o2gm4chl8#

@noonnightstorm

I currently don't get the problem with that issue as the behavior already exists when you drag and drop a group into another group.

Could you please tell me what's the difficulty?

bis0qfac

bis0qfac9#

@noonnightstorm

I would really appreciate your help in this case.
Is there any chance to get a response?

相关问题