@Spark wrote:
here is my code:
diagram.nodeTemplate = Go(go.Node, "Vertical", new go.Binding("itemArray", "items")); diagram.model = Go(go.GraphLinksModel, { nodeDataArray: [ { key: 1, items: [ "Alpha", "Beta", "Gamma", "Delta" ] }, { key: 2, items: [ "first", "second", "third" ] } ] });and the result is
now i want to add a new item in the left node, and i tried this function
function test() { let node = diagram.findNodeForKey("1"); diagram.model.commit(m => { let data = node.data.items; data.push(data[0]); m.set(node.data, "items", data); console.log(data); }, "test"); }but it don’t work, console printed
any one can help me?
Posts: 2
Participants: 2

