Your can use the same controller, just add an additional parameter and name it sort. Then check in the controller what value sort has, and sort your data based on that parameter.
Or if you want to do things on the client side, you can use something like tablesorter, a plugin for jquery.