Hello,
I would like to be able to move nodes I create outside of the default layer. According to the api all I should have to do is set to allow movement in the layer and the nodeTemplate but that doesnt seem to work. I have attached sections of relevant code below to give an example of creating the layer with moveable properties along with creating a node that I would like to be movable in the second layer:
var graphObjectMake = go.GraphObject.make;
/* Create the second layer */
var forelayer = parametricDiagram.findLayer(“Foreground”);
Diagram.addLayerBefore(graphObjectMake(go.Layer, { name: “SecondLayer” }), forelayer);
/* get second layer and set some properties for it */
var myLayer = Diagram.findLayer(“SecondLayer”);
myLayer.allowDelete = true;
myLayer.allowGroup = true;
myLayer.allowLink = true;
myLayer.allowMove = true;
myLayer.allowRelink = true;
myLayer.allowReshape = true;
myLayer.allowResize = true;
myLayer.allowRotate = true;
myLayer.allowSelect = true;
myLayer.pickable = true;
/* Part of the node template code */
Diagram.nodeTemplate = graphObjectMake(go.Node, “Table”,
new go.Binding("layerName", "layerName"),
{
locationObjectName: “BODY”,
locationSpot: go.Spot.Center,
selectionObjectName: “BODY”,
selectable: true,
movable: true,
<span =“apple-tab-span”="" style=“white-space:pre”> … … …
/* Creating the node */
var node = new Object();
node.name = "myName;
node.key = “the key”;
node.color = “red”;
node.layerName = “SecondLayer”;
/* add the node to the diagram */
Diagram.model.addNodeData(node);
///////////////////////////////////////////////