Normally “disabling a node” means setting its permission properties, such as Part.selectable, Part.movable, Part.deletable and so on. Read GoJS User Permissions -- Northwoods Software for more details.
You are asking about changing the appearance of a node when it is in a certain state. What you suggest should work to change the Shape.fill of all of the Nodes that have a Shape named “SHAPE” in them.
But there are alternatives. You could, for example, just set each Node’s GraphObject.opacity to 0.5 or so, to make the whole Node appear translucent, and thus lighter and grayer.
Or you could change your node template(s) so that there was a large Shape covering the whole area of the node. Its Shape.fill and Shape.stroke would normally be null. When you wanted to make the node appear “disabled”, you would change that Shape.fill to be a translucent black, causing the whole node to be grayed out.
For example, this code has a rectangle in front of the body of a simple node. Its fill is bound to a disabled
property on the data:
myDiagram.nodeTemplate =
$(go.Node, "Table",
$(go.Panel, "Auto", // this had been the Node in the original template
$(go.Shape,
{ strokeWidth: 0 },
new go.Binding("fill", "color")),
$(go.TextBlock,
{ margin: 8 },
new go.Binding("text", "key"))
),
$(go.Shape,
{ stretch: go.GraphObject.Fill, fill: null, strokeWidth: 0 },
new go.Binding("fill", "disabled", function(h) { return h ? "#00000030" : null; }))
);
Of course this works for rectangular nodes – you might need to customize the geometry of the Shape for other node templates.