Requested unknown parameter n for row m, column o

Requested unknown parameter n for row m, column o

matus.markmatus.mark Posts: 8Questions: 3Answers: 0

Hi,

I struggle with a problem for a day now. I would like to display checkboxes in the 0th column.

I got this warning:

DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

The data comes from javascript source. (Array of objects. Objects for each row.)

For this column (0th) I do not create data, I do not add an attribute in the datasource object . But even if I add, the problem is the same. (I tried putting 'dummy' as data.)

I created columnDef for the column.

This throws the warning:
(It is the same, if i change data, to anything.)

targets: [0],
render: function (data, type, row, meta) {
      if(type === 'display'){
            data = '<div class="checkbox"><input type="checkbox" class="dt-checkboxes"><label></label></div>';
      }
      return data;
}

While this does not:

targets: [0],
render: function (data, type, row, meta) {
      return '<div class="checkbox"><input type="checkbox" class="dt-checkboxes"><label></label></div>';
}

Any idea would be much appreciated! Thanks!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @matus.mark ,

    Both look ok, so it would help if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 21,450Questions: 26Answers: 4,975
    Answer ✓

    Try using the columns.defaultContent option for that column, like this:
    defaultContent: "",

    Kevin

  • matus.markmatus.mark Posts: 8Questions: 3Answers: 0

    Thank you kthorngren and colin! Kthorngern's suggestion did the trick! :)

This discussion has been closed.