But what about re-ordering rows? That is, allowing the user to change the "sort order" of the data?
If you are going to do this, why not do it right?
The right way is to create an array of objects that JS code receives as same and then put in the sorting, etc., all in the JS code.
It's really not too hard.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.