Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Specify new node's group with ClickCreatingTool

$
0
0

@turnert wrote:

I'm attempting to add a node to a group using the ClickCreatingTool and its archetypeNodeData property.

I'm creating a data object as below:

{
   category:"text-annotation",
   color:undefined,
   figure:undefined,
   group:"at1",
   isGroup:undefined,
   key:"Annotation",
   size:undefined,
   text:3,
}

However, when I create the new node and inspect it's properties, group is undefined.

My template is as follows and is very simple:

    public createSimpleLabelNodeTemplate(): go.Node {
        return this.$go(go.Node, "Auto",
        {
            locationSpot: go.Spot.Center,
            resizable: true
        },
        new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
        this.$go(go.TextBlock,
            {
                margin: 5,
                font: "bold 16px sans-serif",
                textAlign: "center",
                verticalAlignment: go.Spot.Center,
                stretch: go.GraphObject.Fill // make text occupy the space
            },
            new go.Binding("text"))
        );
    }

What am I doing incorrectly? Thanks!

Posts: 10

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles