Location issue of nodes in a group

Hi sir,
When we drags few nodes in a group. It keeps its location. And we save that information to the database.
But when we pull that database. The nodes inside the groups rearranges itself in a different fashion. I want the nodes should keep its saved location inside the group.

This feature works fine for normal nodes on canvas. Please help me, what I am missing in the code.

Do your nodes have a TwoWay Binding on the Node.location property? That is the most common way to keep the model up-to-date.

Have you set Diagram.layout? If so, have you set that layout’s Layout.isInitial to false? Please read GoJS Layouts -- Northwoods Software.

1 Like

Hello sir,

I have tried “isOngoing” property to true and it is working. But “wrappingColumn” is not working.

I want, when I drag a Item to the group, it should auto wrap according to the condition and after that it should remember its location.

This is my code base to do so. Please help me in making the above condition work.

function makeLayout(horiz: any) {  // a Binding conversion function
            if (horiz) {
                return $(go.GridLayout,
                    {
                        wrappingWidth: Infinity, alignment: go.GridLayout.Position,
                        cellSize: new go.Size(5, 5), spacing: new go.Size(20, 20),
                        isInitial: false,
                        isOngoing: true
                    });
            } else {
                return $(go.GridLayout,
                    {
                        wrappingColumn: 3,
                        alignment: go.GridLayout.Position,
                        cellSize: new go.Size(15, 15), spacing: new go.Size(20, 20),
                        isInitial: false,
                        isOngoing: false
                    });
            }
        }

Do you have that problem only with non-horizontal groups?

[EDIT] I just tried your code in a copy of the Regrouping sample, and it seems to be working as I would have expected.