I get data from a server and want to display it using GWT on the client.
GWT is not the problem here, you can replace GWT by Ajax calls or you can transpose it to a real application instead of a web app.
Should the sorting be done on the server or on the client using JavaScript after receiving the data and before displaying them?
I agree with this answer. Unless there's some technical reason against it, sorting is usually best done at the source of data retrieval, but how the data needs to be sorted is up to the presentation layer. So, provide a way for the UI to indicate its sorting needs, and have the backend do the sorting.
Server-side Sorting. When Infinite Scroll is active, the grid does not have all the rows needed to sort on the client. As such, the server-side row model will request rows again each time the sort changes and expect the server to sort the rows.
Between the two options, server-side rendering is better for SEO than client-side rendering. This is because server-side rendering can speed up page load times, which not only improves the user experience, but can help your site rank better in Google search results.
Data sorting is any process that involves arranging the data into some meaningful order to make it easier to understand, analyze or visualize. When working with research data, sorting is a common method used for visualizing data in a form that makes it easier to comprehend the story the data is telling.
Each approach has its pros and cons:
Ideally, the sort should be done on the server because:-
It is best to assume that your client will be having low resources. For example, some people will launch the GWT app from a desktop but another may launch the GWT app from a iPad/phone which is having less CPU/RAM
There are standard ways to do sorting on the server side, for example, by using SQL ORDER BY clause but you may have to implement your own routine/method to do the sorting on the client side.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With