NeXt UI - Updating Node ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 12:17 AM
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
- Labels:
-
NeXt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 05:01 PM - edited 09-25-2023 05:01 PM
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.
