Keep group node's size unchanged

Hi,
We have a group node in a diagram. Now when dragging/dropping nodes into the group, the group’s area changes, and we have trouble finding the new area size and cannot test it.

We want to keep it the node area same for testing purpose.
How can I do that?
Thanks.

I still want the group node’s size can be manually resized.

Groups without Placeholders

Thanks.

I tried. It works fine.

In addition, is it possible to keep the location when reopen a diagram?
We save the locations of all the nodes and use it when rebuild the diagram, but the goJS always shift the entire diagram a bit after reopen and is different from the original location.
Thanks.

You need to set the Diagram.position after the model has been loaded.
You can save the information in the Model.modelData object.
Read Introduction to Models
Example: Draggable Link sample

tryied to InitialLayoutCompleted when creating the diagram, not got the exception complaing it’s not a defined property.

Uncaught Error: Trying to set undefined property “InitialLayoutCompleted” on object: Diagram “reviewDF”




What’s wrong?

What version of GoJS are you using? It sounds like you are using an old version that does not support adding DiagramEvent listeners via GraphObject.make.

I recommend upgrading to version 1.4 if you can.

Thanks, Walter.
BTW, in your reply, you give a link to “intro to models”. I clicked it, it goes to the forum. Could you give me the right link? Thanks.

Oops – sorry about that editing goof. I have fixed it. (We really ought to improve our forum software.)