requested unknown parameter '0' for row 0

requested unknown parameter '0' for row 0

kvn9328kvn9328 Posts: 18Questions: 7Answers: 0
edited November 2014 in Free community support

Hi,

I am getting the unknow paramter error for the below code:

$('#ajaxGroup').dataTable({
        "processing": true,
        "serverSide": true,
        "ordering": false,
        "searching": false,
        "destroy": true,
        "ajax":{
        "url":"ajax-groupView.html",
        "data": function(d) {d.SearchCriteria = id[1];},
        "columns": [{"data":"id"}]
        }
        });
<div id="groupTree" style="overflow: auto">

            <table id="ajaxGroup">
                <thead>
                    <tr>
                        <th>id</th>
                    </tr>
                </thead>
            </table>
</div>

My response:

{"recordsTotal":1,"recordsFiltered":1,"draw":1,"data":[
{"auditDate":null,"id":2,"created":1415029961000,"lastUpdated":1415653500032,"transactionStatus":"ERROR","deliveryStatus":"NONE","functionalTrxnStatus":null,"billingCount":1]}

I figured out that this error happens when datatable is trying to access array 0 for loading cell. But i dont see anything from my response, where i am missing.

@allan,

Could you please look at the above snippet and let me know what i am missing?

Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin
    Answer ✓

    Reformatting the code makes the problem apparent:

    $('#ajaxGroup').dataTable({
        "processing": true,
        "serverSide": true,
        "ordering": false,
        "searching": false,
        "destroy": true,
        "ajax": {
            "url": "ajax-groupView.html",
            "data": function(d) {
                d.SearchCriteria = id[1];
            },
            "columns": [{
                "data": "id"
            }]
        }
    });
    

    columns is currently nested under ajax which is shouldn't be.

    Allan

This discussion has been closed.