DataTables warning: JSON data from server could not be parsed.

DataTables warning: JSON data from server could not be parsed.

basetbaset Posts: 2Questions: 0Answers: 0
edited October 2011 in DataTables 1.8
Hi Allan ,
I have a problem with DataTable. I am trying server side datatables using JSON Array then it does every thing correctly Paging ,sorting ..Etc but when i 'm trying to search then i get this error
BTW : i debugged and find that the jason array is formatted correctly (i checked it )
Could you help me with that ??

Replies

  • GregPGregP Posts: 500Questions: 10Answers: 0
    If the JSON is passing a test (like jsonlint.com) it may still not be suitable for DataTables to process. DataTables is expecting certain variables to be part of the JSON, and the JSON to be nested in a certain way. Check the server-side documentation for an example, and compare it to the JSON that's being sent back.
  • basetbaset Posts: 2Questions: 0Answers: 0
    I think that the jason format is correct because it shows the data from database correctly in paging and sorting in the JSP but when it came to searching this error comes out
    i did some thing like changing versions of datatable , do you think that may cause that error ??
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    > but when it came to searching this error comes out

    Almost certainly the error is in your SQL (assuming you are using an SQL database) that is adding the WHERE condition for your filter then. Have a look at the JSON return in Firebug, there will likely be an error message there indicating what the error is.

    Allan
This discussion has been closed.