JQuery DataTable 1.10 - Getting "Invalid JSON Response" Warning for valid response

JQuery DataTable 1.10 - Getting "Invalid JSON Response" Warning for valid response

surip1980surip1980 Posts: 7Questions: 3Answers: 0

Hi,
I have created a DataTable using Datatable 1.10 js. Table name is - #customprofile_table

When I click the button "Fetch Rules",I'm getting the warning popup "Invalid JSON Response", but the datatable is populated with records. But I got the error in UI Console as > " Uncaught TypeError: Cannot set property 'data' of null".
The datatable is populated with ServerJSON response data "data.ruleList" as shown below:
_```
table1.clear();
table1.rows.add(data.rulesList);
table1.draw();

```
_

I have attached the JSP file (for Datatable creation) and the json output on the "Fetch Rules" button click event.

Can you help me to resolve this error.

Thanks in advance.
Sam

Answers

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin

    Could you give me a link to the page, or a debug trace (from immediately after you get the invalid JSON error) please?

    Allan

  • surip1980surip1980 Posts: 7Questions: 3Answers: 0

    HI Allan,
    This error is not occurring after I have removed the line for reload() function.

    table1.clear(); table1.rows.add(data.rulesList); table1.draw(); //table1.ajax.reload(); ==> Commenting this line fixed this issue

    Thanks a ton

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin

    God to hear you've got it working. To figure out what was going wrong before, I'd really need a link to the page.

    Allan

  • surip1980surip1980 Posts: 7Questions: 3Answers: 0

    Hi allan,

    I dont know how to share the Link to the page as Im testing this in my local Tomcat server.
    Is there any other way where you can get more details on this issue.

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin

    A debugger trace taken immediately after the invalid JSON error might show something.

    Allan

  • surip1980surip1980 Posts: 7Questions: 3Answers: 0

    Allan,

    This is with respect to another thread (https://datatables.net/forums/discussion/38627/datatable-how-to-make-single-column-as-editable-column#latest). Can you provide some solution for that issue.

This discussion has been closed.