Empty values returning from ajax (server side) in datatables

Empty values returning from ajax (server side) in datatables

DigitalDDigitalD Posts: 6Questions: 0Answers: 0
edited August 2018 in Free community support

I am facing with a problem with server side script. The count of the rows are correct but the data is empty. There was an error also that the values cannot empty or NULL. I have added defaultContent to the colums in the script with the message 'Not set' and now the rows are correct but i have only the 'Not set' notification.
I tried to add the UTF-8 Charset but still not working.

What do you need of code to see where the problem is?

Replies

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

    Hi @DigitalD ,

    We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • culterculter Posts: 102Questions: 24Answers: 0

    Hi Colin, how it is possible to simulate server-side processing problem via live.datatables.net ? Where could I upload the serverprocessing.php and ssp.class.php ?

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Maybe collecting debugger output will help:
    https://datatables.net/manual/tech-notes/10#DataTables-debugger

    Post a link to the resulting debug collection.

    Or you could post your Datatables init code, a snippet of the HTML code for your table and the ajax response using the browser's network tools. Steps can eb found here:
    https://datatables.net/manual/tech-notes/1

    Kevin

  • culterculter Posts: 102Questions: 24Answers: 0

    Hi Kevin, thank you for quick response. If I can ask you some general question.. I have large table (20k rows) in mysql and when I load it to html with for loop, it takes about 30 seconds which is useless for me. Will using server-side processing dramatically decrease this time to about 2-5 seconds? Thank you

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    You can read the server side processing doc to get an understanding of the process and requirements:
    https://datatables.net/manual/server-side

    Also take a look at the FAQ:
    https://datatables.net/faqs/index#speed

    Basically with server side processing Datatables will request the data for the current page (10 rows by default) for each draw. A draw occurs when initially loading the table, sorting, searching, etc of the table. Each draw is a network request to the server however the expected data to be returned is that of the current page.

    I would assume that moving to server side processing would reduce the load time to just seconds.

    Kevin

  • DigitalDDigitalD Posts: 6Questions: 0Answers: 0

    Because of the server side it is not possible to show you a link, but i can paste my code? Is it also ok?

  • DigitalDDigitalD Posts: 6Questions: 0Answers: 0

    Because the data is coming from a database

  • DigitalDDigitalD Posts: 6Questions: 0Answers: 0

    Ok, here is my code for js file:

  • DigitalDDigitalD Posts: 6Questions: 0Answers: 0

    Ok, here is my code for js file:

  • DigitalDDigitalD Posts: 6Questions: 0Answers: 0
    edited August 2018

    I got this message after debugging (see answer Kevin): Upload complete - itahiz
    Kevin, is that enough for you?

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    I don't see your code. Why don't you start with collecting debugger output:
    https://datatables.net/manual/tech-notes/10#DataTables-debugger

    Give us the link or code it generates.

    Kevin

  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin

    If you encounter this error, see also this thread.

    Allan

Sign In or Register to comment.