How to change the query parameter name draw ?

How to change the query parameter name draw ?

sandeepbalagopal09sandeepbalagopal09 Posts: 2Questions: 1Answers: 0

I am trying to change the pagination query parameter name from 'draw' to 'page'. Is there an option to do that ?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    Can you add more detail, please, I'm not understanding the question.

    Colin

  • sandeepbalagopal09sandeepbalagopal09 Posts: 2Questions: 1Answers: 0

    datatables send a parameter 'draw' to the api when serverSide is set to true. for getting page 1, it sends draw=1, for page 2 it will be draw=2 etc. My api endpoint is using the parameter page=1. I don't want to change that. I want datatables to change the parameter.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    No, that's now how it works. draw is the request number, not the page. If you go to page 2, then back to page 1, draw for that last page 1 would be 3 - as it's the third request.

    The protocol is discussed here. Also see examples here.

    Colin

This discussion has been closed.