Requested unknown parameter 0 column 0 and row 0 (server side json object)

Requested unknown parameter 0 column 0 and row 0 (server side json object)

lestarylestary Posts: 4Questions: 0Answers: 0
edited November 2019 in Free community support

Hi,
i have json object from my web service like below

{
  "obj": [
    {
      "bytebit": "112.4", 
      "datatype": "Bool", 
      "name": "paa_sw_unit_comunication_lost"
    }, 
    {
      "bytebit": "131.1", 
      "datatype": "Bool", 
      "name": "paa_not_ready"
    }, 
    {
      "bytebit": "131.2", 
      "datatype": "Bool", 
      "name": "paa_unit_not_ready"
    }, 
    {
      "bytebit": "131.3", 
      "datatype": "Bool", 
      "name": "paa_unit_alarm_present"
    }
  ]
}

and my view js

    function test() {
        $('#example').DataTable({
            serverSide : "true",
            processing : "true",
            info : true,
            ajax : {
                url : "/api/filling/all-fault",
                type : "POST",
                dataSrc : "obj",
                columns : [
                    {render:"bytebit"},
                    {render:"datatype"},
                    {render:"name"}
                ]
            }
        });
    }

i want show bytebit, datatype and name, but always got error Requested unknown parameter 0,
i have done reading datatable manual, online forum but still did not got answer,

please help, i got stuck, i don't know what wrong ?
tahnk you, i'm waiting for answer

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @lestary ,

    Change these:

                columns : [
                    {render:"bytebit"},
                    {render:"datatype"},
                    {render:"name"}
                ]
    

    to be

                columns : [
                    {data:"bytebit"},
                    {data:"datatype"},
                    {data:"name"}
                ]
    

    and that should do the trick. See example here.

    Cheers,

    Colin

  • lestarylestary Posts: 4Questions: 0Answers: 0
    edited November 2019

    @coling
    thank you for reply.

    i've change render to data, but, stil did not work, the error still same,
    requested parameter unknown.
    what should i do ?
    i has spent 2 day for fix problem, but still got no answer

  • lestarylestary Posts: 4Questions: 0Answers: 0
    edited November 2019

    @colin

    Updated

    still got same error
    my data come from python flask framework

    please help me :'(

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765

    You have serverSide : "true",. Do you need server side processing? Take a look at this FAQ to determine if you will need server side processing. If not you should remove that config option. Otherwise your server script will need to follow the protocol described here:
    https://datatables.net/manual/server-side

    I suspect the Web Service you are using won't support this protocol and you will need to disable it. Try removing serverSide : "true", to see what happens. If that doesn't help then we will need to see a link to your page or a test case to diagnose the problem.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Or you could generate a debugger image for the developers to look out.

    Kevin

  • lestarylestary Posts: 4Questions: 0Answers: 0

    thank you for reply

    i set some basic configuration,
    but i've done fix the problem,
    the problem in json file i have "obj:" title, after i change the title to "data:" it's work
    i dont know why but title should be "data:" canot used another text

    if u know, can u explain why ??

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    I just noticed that columns initialisation is within the ajax - it isn't supposed to be. Could you your current client-side initialisation code so we can verify again, please.

This discussion has been closed.