ajax.data and serverSide=false

ajax.data and serverSide=false

stadsklestadskle Posts: 4Questions: 0Answers: 0
edited April 2014 in DataTables 1.10
Hi,

I am working with the beta2 release and I need the request I am sending to the server to get the JSON data to be:
1. POST
2. include additional data

I was very happy to read https://next.datatables.net/reference/option/ajax.data and I made an ajax config object. I am able to send it as POST, however, there is not additional data included in the request. When testing with serverSide=true I can see that the data is included, but I do not want to use serverside processing.

Is it intended to be that I cannot use ajax.data when serverSide=true? (if so, why?). And if so, what can I do instead?

To make a simple test case I did this: http://live.datatables.net/pehuhaq/1/edit (yes it does not work, but use something like developer tools and you will see the parameters that are included in the POST request which is my point. You can see that data: {'test':'test-value'} is not a part of the request.

Suggestions are most welcome.

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Looks like it is part of the test according to Safari's web inspector. The test version you set it right there.

    What browser are you using?

    Allan
  • stadsklestadskle Posts: 4Questions: 0Answers: 0
    Sorry, the example has serverSide=true. Please set that to false and try again.
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Yup - something gone wrong there. I'll take a look when I get into the office tomorrow morning.

    Allan
  • aovertonaoverton Posts: 2Questions: 0Answers: 0
    I'm encountering this same issue right now as well.
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Fix is now in the nightly :-)

    Fix is here if you are interested: https://github.com/DataTables/DataTablesSrc/commit/4d968710b

    Allan
  • aovertonaoverton Posts: 2Questions: 0Answers: 0
    You're awesome! Thank you!
  • stadsklestadskle Posts: 4Questions: 0Answers: 0
    Great, thanks!
This discussion has been closed.