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

Adding a secondary type of link

$
0
0

@Giu wrote:

I have implemented the OrgChartExtras diagram on my app.
https://gojs.net/latest/samples/orgChartExtras.html

I'm trying to create the "secondary" links (orange and green) and I succesfully did it as prototype with a HTML form and a Javascript Function:

function addNewLinkType(text) {
var node = myDiagram.selection.first();

    // maxSelectionCount = 1, so there can only be one Part in this collection
    var data = node.data;
    if (node instanceof go.Node && data !== null) {
      var model = myDiagram.model;
      model.startTransaction("modified link" );
      var type = document.getElementById("type").value;
      var who = document.getElementById("who").value;
      var text = document.getElementById("linktext").value;

      myDiagram.model.addLinkData({ from: node.data.key, to: who, category: type, text: text});

      model.commitTransaction("modified link");

      //document.getElementById("mySavedModel").value = myDiagram.model.toJson();
      myDiagram.isModified = false;
    }
  }

But I can't find the way how I can add Orange and green links using drag&drop.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles