Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Saving Location of Node with addNodeData

$
0
0

@dustinormond wrote:

When a user double clicks or uses a context menu to add a new node, the createNode function is called passing the position where the user wants to create the node. The node is created successfully at the specified location; however, when I create multiple nodes and then refresh the page, all newly created nodes move and overlap at the same position as the last created node. How do I make it so that it saves the location of each node individually? Here is the code of my function that is called. I have tried both committing the diagram and the model (see commented code).

function createNode(location) {
	fileDiagram.commit(function() {
		var model = fileDiagram.model;
		// model.startTransaction("add node");
		model.addNodeData({ text: "RELATION", fields:[{name:"", dataType:"", isUnderline:false}], location:location });
		// model.commitTransaction("add node");
	});
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles