0
基於示例http://gojs.net/latest/samples/flowchart.html我已經創建了看起來像下圖所示的自定義節點模板。GoJS自定義節點保存默認值
myDiagram.nodeTemplateMap.add("Action-node",
$(go.Node, "Spot", nodeStyle(),
$(go.Panel, "Auto",
$(go.Shape, "Rectangle",
{ minSize: new go.Size(40, 40), fill: "#FF9191", stroke: null }),
$(go.Panel, "Vertical",
$(go.TextBlock, "Start",
{
font: "8pt Helvetica, Arial, sans-serif",
margin: 8,
stroke: lightText,
editable: true
},
new go.Binding("text")),
$(go.TextBlock, "...",
{
font: "8pt Helvetica, Arial, sans-serif",
margin: 8,
stroke: lightText,
editable: true
},
new go.Binding("text", "subtitle"))
)
),
// three named ports, one on each side except the top, all output only:
makePort("T", go.Spot.Top, false, true),
makePort("L", go.Spot.Left, true, false),
makePort("R", go.Spot.Right, true, false),
makePort("B", go.Spot.Bottom, true, false)
));
問題是,保存按鈕(保存()函數)調用
myDiagram.model.toJson();
只保存默認值JSON字符串。其他的東西,如位置和鏈接都保存正確。我的自定義模板是否存在問題,或者如何將更改保存在圖形中的節點值上?