Closed adamburczy closed 3 years ago
Hello @adamburczy
updateNodeDataFromId only update data values for df-attributes. Not update classes ...
use
editor.drawflow.drawflow.Home.data[id].class = "newclass"
Jero
okay, good to know, thanks for help, have a nice day :)
Hi, I have one more issue about it. I need to add multiple classNames to node. Is there a way to do it? editor.drawflow.drawflow.Home.data[id].class = "newclass anotherclass" does not work, as well as calling this method with one class, 2 times, only class from second call is added.
solved.
what is the proper way to add/change className of node? I tried: editor.updateNodeDataFromId(5, { class : 'newclass' }) but it's not working, document.getElementById(id).classList.add('newclass'), is working but only when connectionCreated happen, for example, i can console.log the newclass at the end of connectionCreated event, but it is not really adding a className to node as well.