Saving a grid state

I have a grid with multiple cell formatting of font, colours, borders and col widths modified etc. Is there an easy way of saving that grid state like…

localstorage.griddata = Grid1_ref.innerhtml

then restoring it by…

Grid1_ref.innerhtml = localstorage.griddata
Grid1.refresh()

Solved myself and very simply. FYI for those interested.

Save grid state…
localStorage.griddata = Grid1_ref.scroller.innerHTML

Restore grid state…
Grid1_ref.scroller.innerHTML = localStorage.griddata
Grid1.refresh()