If you want to do it from code, you could look at the DataGridJson custom component.
Right now I don’t remember how it does it, but I do remember that it is possible to make a column sortable, hence clickable.
Let me know if you don’t understand how the code works, and I will have a look at it and try to help.