cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
333
Views
0
Helpful
1
Replies

NeXt UI - Updating Node ID

lindsayg
Level 1
Level 1

I really enjoy the NeXt framework. I've made numerous tweaks and enhancements, but I have came across a small issue. I want to be able to update a node's name. And that name is also used as it's identity for the node and corresponding links.

I have the following topology config...

 

	// Node and Link identity key attribute name
	identityKey: 'name',
	// configuration for nodes
	nodeConfig: {
		label: "model.name",
		iconType: "model.deviceType",
		color: "model.color"
	},

 

 

The data-id for each node is not directly linked to the model.name. If the name is ever updated, the corresponding data-id is not changed, and that is what is used to bind links together. So if I export the data, and re-import the links are still referencing the old "targets/sources".

Is there a built in watcher or function to update the graph id's of objects?

Thanks

1 Reply 1

lindsayg
Level 1
Level 1

If anyone was interested... I have a workaround at least for now. I register an event to detect changes to the label. I then update all the model data for the attached links. So whilst I'm not updating the NodeID directly, if the graph data is ever saved or re-generated, the ID's will be updated based off the labels. I could force a re-drawing of the graph, but it doesn't matter if a particular node is actually using it's old Node ID for the session. At least the label and the model data is correct.