Issues with sorting while using server-side pagination

Hi all,

The problem I would like to solve here is sorting my table while the table is also paginated.
I am using a server-side (limit offset type) pagination and using the order by keyword with an existing column on the DB and also the value of a selection to allow the user to choose how to sort.

I have tried reading the documentation as well as another thread with no luck, reference:

My table is legacy and I am trying to figure how to use these states with my order by and if using a value of another component is possible with pagination.

Thank you all,
Michael

sometimes it can be tricky to select column name. what type of database are you querying (mysql, postgres)?

For me, I would try using single quote instead of double quote for column name like {{ " ' " + sortBy.value + " ' "}} .

Also, I notice your first column starts with a table alias o. but the second one doesn't, so there could be ambiguity in your column names. let me know if it helps

Thank you for the reply.

I've checked before the there is no ambiguity problem.

The sorting simply seems to not work now the table is paginated.

Hey @Michael_Slabodkin,

I know you said you went through the docs already, but to double confirm, have you tried adjusting your query to match what's described here? We recommend using the sortedColumn and sortedDesc properties.

Also, out of curiosity, have you tried using our newer Table component over the legacy one?

Hi Team,

I have an issue
I am using server-side pagination but sorting is not working how to fix this

help me out

Hi @Ashwin_Kumar, welcome to the forum! :wave:
Check out this topic where they go into this limitation in detail, as well as how to make it work with server-side pagination.

Happy building! :hammer_and_pick: