The example at http://gojs.net/latest/samples/dynamicPorts.html shows how to do two-way binding assuming the data for the model is flat, but I’m trying to bind all positional information under a ‘metadata’ object in my model.
I can store and retrieve the location for nodes using the following code:
new go.Binding("location", "metadata", m => go.Point.parse(m.loc)).makeTwoWay((val, obj) => { obj.metadata.loc = go.Point.stringify(val); return obj.metadata; }),
(although please tell me if there’s a cleaner way)
but I can’t see a sensible way of doing the same with the List. Is there a hook into the code used by the underlying Model.toJSON that can be used?