This is part of GoJS (diagramming) project and "properties" is itemArray, which is defined inside of one node in diagram.
1) This works (hard coded values):
properties: [
{ "property_name": "Prop1", "property_value": "100"},
{ "property_name": "Prop2", "property_value": "101" },
{ "property_name": "Prop3", "property_value": "102" }
]
2) This doesn't work (from data source):
properties: [
data.ObjectPropertiesList.forEach(function (item, i) {
properties.push({ "property_name": item.Item1.toString(), "property_value": item.Item2.toString() });
})
]
2.1) With surrounding code:
myPalette.model = new go.GraphLinksModel([
{ key: "B", text: "some block", color: "blue" },
{ key: "G", text: "Macro", isGroup: true },
{ category: "circle", key: "Gc", text: "A", color: "black", group: "G", loc: "0 0" },
{
category: "table", key: "Ga", group: "G", loc: "60 0",
properties: [
data.ObjectPropertiesList.forEach(function (item, i) {
properties.push({ "property_name": item.Item1.toString(), "property_value": item.Item2.toString() });
})
]
}
], [
{ from: "Gc", to: "Ga" }
]);