i’m trying to update the node’s fill color and not rebuild the entire tree.
the color will be retrieved from the model data which is changed on a button click (this is rebuilt in the servlet and updated)
i’m not sure how to go about this.
what i’m thinking is something like this but i’m not sure if the right way to go about it:
function changeColor(){
//get the modal data
var str = document.getElementById(“mySaveModel”).value;
var mod = go.Model.fromJson(str);
//iterate through the nodes
var nodes = myDiagram.nodes;
while (nodes.next()){
myDiagram.startTransaction(“updateColor”);
var node = nodes.value;
var keyID = node.data.key;
var data = mod.findNodeDataForKey(keyID);
node.fill = data.color;
myDiagram.commitTransaction(“updateColor”);
}
}