What you could do is execute both loops within the page. So the one list will be ontop of the other list. You could then wrap both lists in a div, for example:
Click here to switch between list and grid
// grid wordpress loop here
// list wordpress loop here
By clicking on the anchor link, you will be hiding the grid and showing the list. When you click again, you will show the grid and hide the list – Which seems to be what you were looking for.