You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the table is augmented with geolocation and blacklist data dynamically in HTML, which makes it hard to sort it without redoing the entire process. The current approach is done to get the user data ASAP, and then geolocation lookups are done asynchronously at the client.
The right way to do this is to assign an ID to each table row in the DOM and do the sort as follows:
Read the sorted column into a JS array
Sort it and create a permutation array
Generate a new table in memory by reading the DOM rows in the right order
Replace the DOM table with the table in memory
This approach will allow the table to be updated without having to create a persistent JS data structure to represent the table redundant with the DOM, yet allow the update to happen atomically to avoid display issues or thrashing the DOM.
The text was updated successfully, but these errors were encountered:
Right now the table is augmented with geolocation and blacklist data dynamically in HTML, which makes it hard to sort it without redoing the entire process. The current approach is done to get the user data ASAP, and then geolocation lookups are done asynchronously at the client.
The right way to do this is to assign an ID to each table row in the DOM and do the sort as follows:
This approach will allow the table to be updated without having to create a persistent JS data structure to represent the table redundant with the DOM, yet allow the update to happen atomically to avoid display issues or thrashing the DOM.
The text was updated successfully, but these errors were encountered: