I have some server-side logic that parses the diagram and based on logic choices, will disable certain logic branches and items on that branch.
This information is available to me in a JSON object on web page, keyed by goJS key id.
The best scenario would be to iterate all the items that as disabled, and set the Shape disabled property to true. However, it appears this “disabled” property does not exist, so I can simulate it by changing the color and perhaps other properties to indicate the shape has been disabled.
This is as far as I got for some test code:
myDiagram.startTransaction(“Update1”);
var nodeData = myDiagram.model.findNodeDataForKey(’-5’);
myDiagram.model.setDataProperty(nodeData, “fill”, “#000000”);
myDiagram.model.setDataProperty(nodeData, “text”, “this has been updated”);
myDiagram.commitTransaction(“Update1”);
I can set the text but changing the color has no effect. I believe i need to get the shape object somehow. How do I go about doing this?
Thanks,
Bryan