How to sort a table which has live data coming in from websocket?
I have a table where I display several columns with numbers in them and people can sort them in ascending or descending order. The one major problem is let's say I had 4 numbers 1 5 2 3 and I sorted them in ascending order 1 2 3 5 , what happens when the second number changes to 7?
Couple of options possible
- Disable live data when the user clicks sort in any order and have a SWITCH at the top of the website to re-enable it (Brings a lot of questions, how long to keep it disabled ? until the user clicks live again? and then disable it once again if the person sorted again? This means everytime you sort something you have to go back and enable live data again)
- Keep the sorting on and let the rows go up and down as the value in their columns change (I guess this will be horrible)
- Sort once and let the column show ascending state with the up arrow even if the data inside the column is not in ascending order anymore (Not sure if that's fair. You sort once by an initial order, if the data changes at the next instant, the initial order is still maintained)
- By default my table is sorted by the ID column, take the table back to the ID column if any data value changes (Very bad I guess since the user wont be able to see anything if it goes back to the default order)
Am I missing something? How do I handle this case?