Unable to get the draw count on table.ajax.reload();

Unable to get the draw count on table.ajax.reload();

FrancoisLemieuxFrancoisLemieux Posts: 9Questions: 3Answers: 0

Hi, i know that i need to increase the Draw counter. according to the a This is used by DataTables to ensure that the Ajax returns from server-side processing requests are drawn in sequence by DataTables (Ajax requests are asynchronous and thus can return out of sequence). This is used as part of the draw return parameter (see below).

I got stuck on processing and realized that i need to increment the counter but i have no clue how to pass this variable through ajax

my ajax section looks like

ajax:  {
  url: 'Modules/RTA/Dashboards/AgentStatesRTJson.php',
  type: 'POST',
  "data": {
    "varX" :'x'
  }

I get my varX via $_POST['VarX'] in php but how to get the counter?

thank you!

Answers

  • kthorngrenkthorngren Posts: 21,302Questions: 26Answers: 4,947

    I'm confused by your question. With server side processing the draw, along with other parameters, are sent in the server side ajax request. Not sure I understand why you are trying to send it via the ajax data option.

    You have "varX" :'x'. Maybe you want "varX" :x instead - notice no quotes around x. This would provide the value in the variable x instead of the string 'x'.

    If this doesn't help please provide more info and maybe more of your JS code so we can see the context of your above ajax request.

    Kevin

  • FrancoisLemieuxFrancoisLemieux Posts: 9Questions: 3Answers: 0
    edited August 2018

    Sorry if i am unclear, the VarX is actually a link to a permalink, my goal is to use the same php page with many different report, those php pages refers to a reporting tool that we have.

    What i really need to know is how to get the draw count from datatables when posting throught an ajax server side because i will need to use this also to populate the current draw + 1 to refresh the latest version of the data.

  • FrancoisLemieuxFrancoisLemieux Posts: 9Questions: 3Answers: 0

    Sorry i think i am still unclear,

    In my php page, how do i get the draw variable?

    thanks.

This discussion has been closed.