I have a table of books with this data: name, description, cost, year. I show 15 rows and pagination using AJAX. Each header of each column is clickable and let the user sort the data. The problem comes here: I don't know if I may sort with javascript the 15 rows that are shown or sort the n results of the query on server.
What I have thought is that if I sort just the 15 rows, the user probably will lose some data. But, if I sort the n results, the pagination should start from 1 again, always. Because if I show the same page, the user probably will see other data.
I really don't know, maybe I'm wrong and that's why I'm asking you, what's the best usability way. Thank you very much!