How to change value div after drag and drop?

I have question “how to change DIV on left form after drag and drop from palete to diagram without click button?”

I try take save function into nodeTemplateMap.add

<span =“Apple-tab-span” style=“white-space:pre”> myDiagram.nodeTemplateMap.add("", // the default category

<span =“Apple-tab-span” style=“white-space:pre”> $(go.Node, “Spot”, nodeStyle(),
new go.Binding(“location”, “loc”, go.Point.parse).makeTwoWay(go.Point.stringify),
<span =“Apple-tab-span” style=“white-space:pre”> { contextMenu : nodeMenu}
<span =“Apple-tab-span” style=“white-space:pre”> ,
<span =“Apple-tab-span” style=“white-space:pre”> “Auto”,
<span =“Apple-tab-span” style=“white-space:pre”> $(go.Shape, “Rectangle”,
<span =“Apple-tab-span” style=“white-space:pre”> { minSize: new go.Size(40,60), fill: block, stroke: null}
<span =“Apple-tab-span” style=“white-space:pre”> ),
{ font: “bold 11pt Helvetica, Arial, sans-serif”,
//stroke: lightText,
<span =“Apple-tab-span” style=“white-space:pre”> stroke: redgrad,
margin: 8,
maxSize: new go.Size(160, NaN),
wrap: go.TextBlock.WrapFit,
editable: true },
new go.Binding(“text”, “key”).makeTwoWay()),
{ click: function(e, obj) { save(); } }
// four named ports, one on each side:
makePort(“T”, go.Spot.Top, false, true),
makePort(“L”, go.Spot.Left, true, true),
makePort(“R”, go.Spot.Right, true, true),
makePort(“B”, go.Spot.Bottom, true, false)
<span =“Apple-tab-span” style=“white-space:pre”> );<span =“Apple-tab-span” style=“white-space:pre”>

<span =“Apple-tab-span” style=“white-space:pre”> function save() {
<span =“Apple-tab-span” style=“white-space:pre”> var str = myDiagram.model.toJson();
<span =“Apple-tab-span” style=“white-space:pre”> document.getElementById(“mySavedModel”).value = str;
<span =“Apple-tab-span” style=“white-space:pre”> }

I’m newbie in gojs, Please I need suggest Thank u :)

Are you asking how to automatically save the diagram each time the user has changed something?

If so, implement a Model Changed listener that saves the model after a Transaction ChangedEvent. The Planogram and Record Mapper samples demonstrate this, although they just save the model to a text element on the page so that you can see it.

Ok thank you walter, my problem clear after i’m attach my save() function into link function and that is solve my problem, but thank for your suggest walter :)