How to access the "draw" parameter?

How to access the "draw" parameter?

cosucosuuducosucosuudu Posts: 8Questions: 2Answers: 0

Hi,

I'm trying to get my Datatable running with client-based processing and a json-response from a customized MySql-query. My Ajax-request and the response is already working, but it is not complete yet. I've understood that I have to put the parameter "draw" in my json-response, but unfortunately I didn't find how to get this value (or how it is sent within the Ajax-request). Does someone can explain how to do this?

Cheers,
Christoph

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Yep, data is the default, but you can change that to anything with ajax.data,

    Colin

  • cosucosuuducosucosuudu Posts: 8Questions: 2Answers: 0

    Hi Colin,

    I have two user-defined parameters in "data", and I can get them by $_POST['parameter'] in my php-script.

    But how can I get the value of "draw"? Something like $_POST['data.draw']?

    Greetings,
    Christoph

  • cosucosuuducosucosuudu Posts: 8Questions: 2Answers: 0

    I've solved my problem. The parameter is accessible via $draw = intval($_REQUEST['draw']); in the server-side php-script.

    Additionally I had to remove my success, error and dataSrc-Entrys in my Ajax-Request to get it running.

    Cheers!

This discussion has been closed.