Any way to detect if a Table Header Column is clicked?

Is there a way to identify that a specific table header column as been clicked. Since tables are sortable dynamically (via allowordering) there should be a eventlistener. 

I am working on grouping by that column (a la building aggregate model dynamically and new dynamic table) but I need to know which column they are clicking on.

Any ideas? Thanks in advance!
AP

Great question. Nothing OOB declaratively at this point, though that would be a great idea to post here on the community (I’ve heard several SEs ask for something similar). Got this as a response from a code-savvy Skuid SE: "It may be possible to add a click event to column headers with inline JS, but it’s going to be some complex custom code."

Hope that helps!

I figured out a very rudimentary way of doing it. I will post it soon once I confirm that it actually persists