I am converting a model to JSON and storing into a DB. . I am getting errors when i use the model.fromJSON method. I am getting errors converting back from JSON. The JSON looks ok. Appreciate any help you can give me.
Thanks
Information below
examples here :
property set error: Error: Link.routing value is not an instance of a constant of class Link: [object Object]
property set error: Error: Link.curve value is not an instance of a constant of class Link: [object Object]
property set error: Error: Link.routing value is not an instance of a constant of class Link: [object Object]
property set error: Error: Link.curve value is not an instance of a constant of class Link: [object Object]
property set error: Error: Link.routing value is not an instance of a constant of class Link: [object Object]
property set error: Error: Link.curve value is not an instance of a constant of class Link: [object Object]
property set error: Error: Link.routing value is not an instance of a constant of class Link: [object Object]
The JSON which is stored in the DB from the model.toJSON method is below
“jsonString” :
"{ “class”: “go.GraphLinksModel”,
\n “nodeDataArray”: [ \n{“key”:“a9LxFwk9ApG7ubpN7”, “text”:“Capability”,
“font”:“8pt serif”, “height”:60, “width”:150, “isShadowed”:true, “shadowColor”:“gray”,
“classType”:“capability”, “group”:“capability”, “shadow”:true, “shadowOffset”:{“class”:“go.Point”,
“x”:10, “y”:10}, “color”:{“class”:“go.Brush”, “type”:“Linear”, “start”:
{“class”:“go.Spot”, “x”:0, “y”:0.5, “offsetX”:0, “offsetY”:0}, “end”:{“class”:“go.Spot”, “x”:1, “y”:0.5, “offsetX”:0, “offsetY”:0},
“colorStops”:{“0”:"#FFD9BA", “1”:"#FFD9BA", “0.5”:"#FFD9BA"}}, “fig”:“RoundedRectangle”, “location”:“319.0000000000007 184.96108398437488”, “newElement”:false,
“category”:“capability”, “description”:“none”, “name”:“Capability”, “theID”:“a9LxFwk9ApG7ubpN7”, “theObject”:{“name”:“Capability”, “description”:“none”, “open”:true,
“fixedRoot”:false, “type”:"", “createdAt”:{“class”:“Date”, “value”:“2015-12-02T20:24:47.535Z”}, “createdBy”:“TuqcJqenyYcw8kzPr”, “text”:“Capability”, “theID”:“a9LxFwk9ApG7ubpN7”,
“key”:“a9LxFwk9ApG7ubpN7”, “category”:“capability”, “group”:“capability”, “classType”:“capability”}, “opacity”:1, “layerName”:“front”, “isGraphicShape”:false},\n{“newElement”:false,
“category”:“capability”, “description”:"", “name”:“group”, “text”:“capability”, “theID”:“group”, “theObject”:{“name”:“group”, “description”:“Group Node”, “parentID”:“0”,
“classType”:“capability”, “theID”:“group”}, “key”:“capability”, “opacity”:1, “shadow”:true, “shadowOffset”:{“class”:“go.Point”, “x”:10, “y”:10}, “shadowColor”:“gray”, “group”:"",
“color”:“grey”, “width”:150, “height”:60, “classType”:“capability”, “fig”:“RoundedRectangle”, “layerName”:“front”, “isGraphicShape”:false, “isGroup”:true},\n{“key”:“N2qa2ZhLej7tbhSFX”,
“text”:“Capability”, “font”:“8pt serif”, “height”:60, “width”:150, “isShadowed”:true, “shadowColor”:“gray”, “classType”:“capability”, “group”:“capability”, “shadow”:true,
“shadowOffset”:{“class”:“go.Point”, “x”:10, “y”:10}, “color”:{“class”:“go.Brush”, “type”:“Linear”, “start”:{“class”:“go.Spot”, “x”:0, “y”:0.5, “offsetX”:0, “offsetY”:0},
“end”:{“class”:“go.Spot”, “x”:1, “y”:0.5, “offsetX”:0, “offsetY”:0}, “colorStops”:{“0”:"#FFD9BA", “1”:"#FFD9BA", “0.5”:"#FFD9BA"}}, “fig”:“RoundedRectangle”, “location”:“319 294.961083984375”,
“newElement”:false, “category”:“capability”, “description”:“none”, “name”:“Capability”, “theID”:“N2qa2ZhLej7tbhSFX”, “theObject”:{“name”:“Capability”, “description”:“none”, “open”:true,
“fixedRoot”:false, “type”:"", “createdAt”:{“class”:“Date”, “value”:“2015-12-02T20:24:48.877Z”}, “createdBy”:“TuqcJqenyYcw8kzPr”, “text”:“Capability”, “theID”:“N2qa2ZhLej7tbhSFX”,
“key”:“N2qa2ZhLej7tbhSFX”, “category”:“capability”, “group”:“capability”, “classType”:“capability”}, “opacity”:1, “layerName”:“front”, “isGraphicShape”:false}\n ],
\n “linkDataArray”: [ \n{“from”:“a9LxFwk9ApG7ubpN7”, “to”:“N2qa2ZhLej7tbhSFX”, “curve”:{“cc”:“JumpOver”, “vG”:11}, “routing”:{“cc”:“Orthogonal”, “vG”:2}},\n{“from”:“a9LxFwk9ApG7ubpN7”,
“to”:“N2qa2ZhLej7tbhSFX”, “curve”:{“cc”:“JumpOver”, “vG”:11}, “routing”:{“cc”:“Orthogonal”, “vG”:2}}\n ]}",