Position of added member in group

i m working on a diagram where i add nodes to a group programmatically
when i click on load parent a new node is added and the attribute is added as child of loaded node
what i want is to keep the attribute at its place and place the parent above it

Is your Group.layout a GridLayout? I think you will want to set https://gojs.net/latest/api/symbols/GridLayout.html#sorting and https://gojs.net/latest/api/symbols/GridLayout.html#comparer so that you have complete control over the ordering. The same holds true if you are using a TreeLayout.

      this.Go(go.TreeLayout, {
        alignment: go.TreeLayout.AlignmentStart,
        angle: 0,
        compaction: go.TreeLayout.CompactionNone,
        layerSpacing: 19,
        layerSpacingParentOverlap: 1,
        nodeIndentPastParent: 1.0,
        nodeIndent: 4,
        nodeSpacing: 1,
        setsPortSpot: false,
        setsChildPortSpot: false

this is my layout