2017-11-28 8 views
0

私は新しいノードと編集ノードを作成するノードに対して、後の時間にテキストエディットを可能と取得nodeDataArray図からGOJS

 window.diagram = 
$(go.Diagram, "myDiagramDiv", 
{ 
    initialContentAlignment: go.Spot.Center, // center Diagram contents 
    "undoManager.isEnabled": true, // enable Ctrl-Z to undo and Ctrl-Y to redo 
}); 
      // the node template describes how each Node should be constructed 
      diagram.nodeTemplate = 
      $(go.Node, "Auto", // the Shape automatically fits around the TextBlock 
      $(go.Shape, "RoundedRectangle", // use this kind of figure for the Shape 
      // bind Shape.fill to Node.data.color 
      new go.Binding("fill", "color")), 
      $(go.TextBlock, 
      { margin: 3 ,// some room around the text 
       editable: true }, // permet de le modifier 
      // bind TextBlock.text to Node.data.key 
      new go.Binding("text", "key")), 
     ); 
      diagram.linkTemplate = 
      $(go.Link, 
      $(go.Shape),       // this is the link shape (the line) 
      $(go.Shape, { toArrow: "Standard" }), // this is an arrowhead 
      $(go.TextBlock,      // this is a Link label 
      new go.Binding("text", "text")) 
     ); 

私が得ることができるリンクしています 、GoJSを使用して図を作っています編集後でも、編集後nodeDataArrayとlinkDataArrayを得るすべてのヘルプ図 を編集した後

window.diagram.GraphLinksModel.nodeDataArray 

しかし、私は同じオブジェクトの配列を取得usinオブジェクト?

答えて

0

私は

$(go.TextBlock, 
      { margin: 3 ,// some room around the text 
       editable: true}, 
      // bind TextBlock.text to Node.data.key 
      new go.Binding("text", "key").makeTwoWay()), // makeTwoWayis what i neededd 
     ); 
をbindgingながら、私は機能を追加する必要があり 、答えを見つけました
関連する問題