Display a single view in different view format
I think Your Question resembles the video tutorial series in Code karate:

Multiple Views Series

Please Check It out... By adding and removing classes when clicking the grid and list icons using jQuery make this done..