Hacker News new | ask | show | jobs
by ByteMuse 5292 days ago
sortable tables in HTML are nearly impossible to implement.

This is definitely a solvable (and solved) problem.

and where do you sort? front end or back end? how much data are processing?

If you have all the data loaded clientside, sort it there. Otherwise, just make a call to the server to query for data compliant with the new sort order. Both methods are fairly low cost.

1 comments

Sorting on the back end is generally not cheap unless your dataset is very small (or unless it's indexed, but with arbitrary sorting it wouldn't be).