Dear sir,
In gojs seating chart i am used item array for arranging the seats around tables. Now i want to insert the seat to item array i tried like this
myDiagram.nodeTemplateMap.add(“SquareTemp”,
$$(go.Node, “Spot”, tableStyle(),
$$(go.Panel, “Spot”,
$$(go.Shape, “Rectangle”,
{
///////////////////////////
),
$$(go.TextBlock,
///////////////////////////////////////
),
new go.Binding(“itemArray”,“items”),
{
itemTemplate:
$$(go.Panel, “Spot”,
new go.Binding(“direction”,“dir”),
new go.Binding(“name”, “id”),
new go.Binding(“alignment”, “align”),
new go.Binding(“alignmentFocus”, “focus”),
$$(go.Shape, { width: 45, height: 45 },
///////////////////////////////////
),
$$(go.TextBlock, new go.Binding(“text”, “sno”).makeTwoWay(),
/////////////////////////////////
)
)
)
}
)
);
var newnode = { category: “SquareTemp”, key: “100”, “guests”: {}, name:“Square”, items: [{ sno: “1”, id: “1”, align: new go.Spot.parse(“0.2 0”), focus: new go.Spot.parse(“0.5 1”), rte: 0,dir:“top”}, { sno: “1”, id: “2”, align: new go.Spot.parse(“0.6 0”), focus: new go.Spot.parse(“0.5 0”), rte: 0, dir:“top”}]};
myDiagram.model.addNodeData(newnode);
Now i used fallowing statement to insert seat to item array
myDiagram.model.findNodeForKey(100).addArrayItem(“items”,{ sno: “1”, id: “3”, align: new go.Spot.parse(“0.8 0”), focus: new go.Spot.parse(“0.5 0”), rte: 0, dir:“top”})
But its not working could you please help me how to add or insert seat object to the item array
Regards,
AR