Requested unknown parameter 0 for row 0, column 0

Requested unknown parameter 0 for row 0, column 0

ebagaipoebagaipo Posts: 13Questions: 5Answers: 0

Hi,

Below is my code:

    function onClickFormMetadataConfig(columnDescriptions, formMetadataConfigName) {
        var columnNames = columnDescriptions.split(',');
        var mDataArray = new Array();
        var keys = Object.keys(columnNames);
        for (var i = 0; i < keys.length; i++) {
            var temp = new Object();
            if (columnNames[i].toString().length > 0) {
                temp["sTitle"] = columnNames[i].toString();
                mDataArray.push(temp);
            }
        }

        console.log(columnDescriptions.split(',')[0]);
        console.log(JSON.stringify(columnDescriptions.split(',')));

        var urlData = '@Url.Action("GetFormMetadata", "FormMetadata")/?formMetadataConfigName=' + formMetadataConfigName;
        $.ajax({
            url: urlData,
            success: function (response) {
                console.log(response);
                if ($('#tblFormMetadata').length > 0) {
                    dataTable2 = $('#tblFormMetadata').dataTable({
                        "responsive": true,
                        "autoWidth": true,
                        "sDom": "Tft<'row DTTTFooter'<'col-sm-6'i><'col-sm-6'p>>",
                        "iDisplayLength": 10,
                        "bProcessing": true,
                        "bServerSide": true,
                        "bSort": true,
                        "destroy": true,
                        "bFilter": false,
                        "bSearchable": false,
                        "sAjaxSource": urlData,
                        "aoColumns": mDataArray
                    });
                }
            }
        });
    }

The code works in displaying the columns. But it will not display the data. I've got an error Requested unknown parameter 0 for row 0, column 0...

![(https://datatables.net/forums/uploads/editor/8m/mk7wrzoq3vpa.png "")

Thanks in advance.

Answers

  • tangerinetangerine Posts: 3,361Questions: 38Answers: 394

    The link in the error message is there for you to follow. It provides diagnostic steps enabling you to resolve your problem.

  • ebagaipoebagaipo Posts: 13Questions: 5Answers: 0
    edited March 2019
    for (var i = 0; i < keys.length; i++) {
        var temp = new Object();
        if (columnNames[i].toString().length > 0) {
            temp["sTitle"] = columnNames[i].toString();
            temp["mData"] = columnNames[i].toString();   <------------ added
            mDataArray.push(temp);
        }
    }
    
  • colincolin Posts: 15,215Questions: 1Answers: 2,592

    As @tangerine said, there's detailed diagnostic information in link within the error message - the first step would be to follow that and let us know what steps you did and the outcome.

This discussion has been closed.