Very stuck. Requested unknown parameter '1' for row 0, column 1 (live repro and debug provided)

Very stuck. Requested unknown parameter '1' for row 0, column 1 (live repro and debug provided)

ktraveletktravelet Posts: 4Questions: 2Answers: 0

Live:
http://live.datatables.net/kehibufo/1

Debugger:
https://debug.datatables.net/utacib

Its the "cryptic" error which is clearly defined at https://datatables.net/manual/tech-notes/4 but I cant get to the bottom of it. I'm really stuck here and not sure what to do. Everything seems fine.

Thanks for all the help!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,299Questions: 26Answers: 4,769
    Answer ✓

    Thanks for the test case! The problem is in your -api row.add()`. You have this:

            sqlHashReportTable.row.add([
                summedArray[j].planId,
                {
                    sort: summedArray[j].preparationTime,
                    display: convertMsToPretty(summedArray[j].preparationTime)
                },
            ........
    

    Datatables just expects the values not the render options. You should read up on columns.data, columns.render, orthogonal data and rows.add().

    I re-worked your example into this example using the above techniques:
    http://live.datatables.net/borasami/1/edit

    Basically I used rows.add() to add all your rows as objects. Then used columns.render to call convertMsToPretty() on columns 1-6 and got the total using the data parameter of the render function for column 7.

    Post any questions.

    Kevin

  • ktraveletktravelet Posts: 4Questions: 2Answers: 0

    Great response, learned a bunch and fixed my problem, thanks a ton.

This discussion has been closed.