After upgrading DataTables from 1.10.20 to 1.10.21, the page only shows "Processing...", no tables

After upgrading DataTables from 1.10.20 to 1.10.21, the page only shows "Processing...", no tables

marcohuamarcohua Posts: 6Questions: 2Answers: 0

Each version of DataTables works perfectly from 1.10.1x to 1.10.20, but not the latest 1.10.21.

Here is my major lib's version:
Editor v1.9.4
jQuery 3.5.1,
jQuery-ui 1.12.1
BoosStrap 4.5.0

There are some other DataTable's plug-ins included, if needed, they are going to be posted later.

The data source is backed by a Java project and Spring framework, so jquery.spring-friendly.js is imported to convert array data type, which is very helpful.

The whole table shows buttons and column names, "Processing...", but no data or rows. The ajax call works, all the data returns from server side. No DataTables relative error shows in Chrome console. Two screen-shots are attached.

I do appreciate if anyone can advice. Please let me know if you need some other info. Thank you.

Answers

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

    That console message isn't one of ours, so is it possible something else is interfering with the ajax message? Are you able to link to your page so we can take a look?

    Colin

  • marcohuamarcohua Posts: 6Questions: 2Answers: 0

    Thank you for the quick response. The project is for internal use only, sorry, no public url to access. Please advise me how to export the console messages expected. I will try my best.

    I compared the 1.10.20 to 1.10.21 line by line. Here is what I found in https://cdn.datatables.net/v/dt/dt-1.10.21/datatables.js.

    Line number 4127 of 1.10.21:
    "if ( draw !== undefined )"

    If the line is changed to be same as the following in 1.10.20, the table will show up as usual.
    "if ( draw )"

    Fortunately, it is working now.

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Without the change in the datatables.js file, can you use the debugger to give me a trace please - click the Upload button and then let me know what the debug code is. I'd like to see what is causing the issue.

    Thanks,
    Allan

  • marcohuamarcohua Posts: 6Questions: 2Answers: 0

    Here is the code I got in the debugger:

    https://debug.datatables.net/ixavul

    Thank you.

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Thanks!

    It shows that the server is returning:

    "draw": 0,

    That should never be the case with server-side processing. It should return the value of the draw parameter that was submitted to the server (parsed as an integer for security).

    I think that is what is causing the issue here - 1.10.21 has just got a bit more strict!

    Allan

  • marcohuamarcohua Posts: 6Questions: 2Answers: 0

    Yes. After the draw is put back into a response body, the table shows up normally. Hope the kind of error can be noted in further release notes.

    Thanks to Allan and Colin.

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

    Excellent. The solution was documented already - https://datatables.net/manual/server-side

    The draw counter that this object is a response to - from the draw parameter sent as part of the data request.

    But yep, glad all working.

    Colin

This discussion has been closed.