@MichaelPolla wrote:
Hello,
Is it possible to access a property of the parent group from within a template that is used for subgroups ?
I though about using containingGroup but I didn’t find how.Here an example of what I’d like to achieve.
Subgrouptext would be of thecolorvalue from the parent group,MainGroup.var nodeDataArray = [ // Groups { key: "MainGroup", isGroup: true, color: "red"}, { key: "Subgroup", isGroup: true, group: "MainGroup", category: "subgroup" }, ]; var subgroupTemplate = $(go.Group, "Vertical", $(go.TextBlock, { alignment: go.Spot.Left }, new go.Binding("text", "key"), new go.Binding("stroke", >>>containingGroup.color<<<)) ); diagram.groupTemplateMap.add("subgroup", subgroupTemplate);Best regards,
Michaël Polla
Posts: 3
Participants: 2