tableid= Importhistory-Requested unknown parameter 'file' for row 0 ,column 0

tableid= Importhistory-Requested unknown parameter 'file' for row 0 ,column 0

mt9108mt9108 Posts: 3Questions: 2Answers: 0
edited May 2017 in Free community support

Hi All
I am facing this warning eventhougn the no.of colums match in the table.Could you please help on this.

HTML -

   var dataset = getProspectdata();
        alert(dataset);
        $(document).ready(function () {
            $('#Importhistory').dataTable({

                data: dataset,
                "columns": [
                    {"data": "file"},
                    {"data": "dstatus" },
                    {"data": "proc" },
                    {"data": "dscrubbed" },
                    {"data": "create" },
                  
                ]
            });
        });

========
dataset output from the function is as below:(JavaScript)

[
              { "file": "Sourcefile", "dstatus": "Scrubbed", "proc": "Scrubbed", "dscrubbed": "4/28/2017 2:37 PM", "create": "4/28/2017 2:37 PM" },

        ];

but I am facing the error.
Please help on this.

Answers

  • mt9108mt9108 Posts: 3Questions: 2Answers: 0

    but when I hard code the data as below: it is working fine
    var dataset = [
    { "file": "Sourcefile", "dstatus": "Scrubbed", "proc": "Scrubbed", "dscrubbed": "4/28/2017 2:37 PM", "create": "4/28/2017 2:37 PM" },

        ];
    

    I am facing issue only if I am getting data from the function from javascript as mentioned above.

  • allanallan Posts: 63,889Questions: 1Answers: 10,530 Site admin

    Does getProspectdata make an Ajax call? Keep in mind what the first a in Ajax stands for! It is async.

    You'd need to have a callback that will pass the data to DataTables. Or just have DataTables do the Ajax call for you.

    Allan

This discussion has been closed.