How does the records order of the server-side processing mode example is kept?

How does the records order of the server-side processing mode example is kept?

UdiDUdiD Posts: 16Questions: 7Answers: 1
edited August 2017 in Free community support

I'm going through the DataTables documentation, and I'm now focusing on the server-side processing mode.
What I'm trying to understand is how does the order of the records retrieved from the server is kept?

Specifically, I'm talking about this example.
What I do see happening is, for example, when paging from page 1 to page 2, Ajax returns 10 entries that were retrieved from the database (starting with "Zenaida Frank", ending with "Gavin Joyce"), and are drawn.
What I don't see is any code controlling the order of the records that should be retrieved, so that when I go back to page 1, I'd see again the same 10 records that were there (starting with "Jackson Bradshaw", ending with "Ashton Cox").

What am I missing?

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    Reading up on DataTables' "sent parameters" might help.
    https://datatables.net/manual/server-side#Sent-parameters

    I'm puzzled by your description of the example - I'm not seeing what you're seeing.
    Page 1 shows "Airi Satou" to "Cedric Kelly". Page 2 shows "Charde Marshall" to "Gavin Cortez". That's without altering the page length or changing the default sort sequence.
    Naturally, when paging back from 2 to 1, you'll see the same records that were there in the first place - assuming no interim re-sorting.

  • UdiDUdiD Posts: 16Questions: 7Answers: 1

    Thank you @tangerine (regarding the ordering: I guess I did some sorting and that's why I saw different records)

This discussion has been closed.