Matrix display - Unknown parameter '0' for row 0, column 0 error -- TN #4

Matrix display - Unknown parameter '0' for row 0, column 0 error -- TN #4

hnhegdehnhegde Posts: 68Questions: 17Answers: 0

Hello,
I am trying to display data in a matrix format using DataTables. I went through TN #4 and I believe I have covered all the aspects mentioned there in, especially the note pertaining to:

 # cells = # rows * # columns

However, I am still getting this error. Have uploaded my debug trace at: http://debug.datatables.net/osevaz
Would appreciate inputs from seasoned hands,

Regards,
Harsha

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    Hi Harsha,

    I presume that the error is happening for the #returnsDueByStateTable table? The reason for that is that the data being returned from the server for each row is in the format:

        {
            "May 7, 2017": null,
            "July 31, 2017": null,
            "May 31, 2017": null,
            "county": "",
            "May 15, 2017": 1,
            "DT_RowId": "row_1"
        }
    

    But you haven't told DataTables which property should be used for each column. You would need to have something like:

    columns: [
      { data: "May 7, 2017", defaultContent: '' },
      ...
    ]
    

    See this section of the manual for more details.

    Allan

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    Thanks Allan, that worked.

This discussion has been closed.