Hi,
I created a button to add new Swimlanes to my diagram like that:
myDiagram.nodeTemplateMap.add(“NewLane”,
$(go.Node, “Auto”,
{locationSpot: go.Spot.Center},
$(“Button”, {
text: “New Swimlane”,
click: newLane
}
)
));
myPalette = $(go.Palette, "myPalette", {
nodeTemplateMap: myDiagram.nodeTemplateMap,
model: new go.GraphLinksModel([
{ category: "NewLane" },
])
});
<font color="#0000CC">function newLane() {
myDiagram.startTransaction("newLane");
myDiagram.model.addNodeData({
key: 'myKey',
text: 'myText',
isGroup: true,
height: 100
});
myDiagram.commitTransaction("newLane");
}</font></font>
Doing like this it doesn’t save the parameters (like height) when the diagram is saved.
I have the deep feeling that this is not the right way to do.
Can you enlighten?
Thank you