How to set background of diagram with undo/redo support

I have an memo editor which use GoJS diagram.
In editor. there is provision to set background memo.
I couldn’t find any solution to set background of diagram with undo/redo support.
Is it possible to set background of diagram with undo/redo support?

When I set
diagram.grid.elements.each(function(s) { s.stroke = “transparent”; });

It is working fine .Thanks