Unknown Parameter 0

Unknown Parameter 0

MarcJMarcJ Posts: 4Questions: 0Answers: 0
edited January 2013 in DataTables 1.9
Hello,

I'm receiving the "Unknown Parameter 0" error, however I don't get the error on the first initialization. My document can contain multiple datatables, however this particular page only has one.

Here is my debug data: http://debug.datatables.net/anusic

I have a dropdown one of the columns. When the dropdown changes, the onchange event is fired. Here is where I get the error:

$(document).off("change", '.companyContact');
$(document).on("change", '.companyContact', function (e) {
var oTable = $(this).parents('table').dataTable();
});

Thanks for any guidance.

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    aoColumns defined 7 columns in the table, so there much be 7 column headers and 7 columns in all rows in the table. Is that the case? It looks to me that there are only 6 columns in the DOM?

    Allan
  • MarcJMarcJ Posts: 4Questions: 0Answers: 0
    The original DOM, before datatables was initialized, had 7 columns. The "bVisible": false on column 6 removes that column from the DOM. So, I removed that column all together but I still get the same error when I try to re-access the table with var oTable = $(this).parents('table').dataTable(). Again, I'm not getting error on the initial initialization of the datatable.
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Ah okay - that would explain why there is a column mission gin the HTML. Doesn't explain the problem you are having though. I think we'd need a test case showing the issue to be able to diagnose what is going on. Can you link us to one please.

    Allan
  • MarcJMarcJ Posts: 4Questions: 0Answers: 0
    This is for an intranet site so I don't have any live examples. However, if you paste the html from the debugger into a page and on document load, initialize the datatable, then add the onchange event that I pasted earlier, you should receive the error.

    I've tried with an empty table that only had the dropdown, and it still gave the same error. The odd thing is, after the initial error, everything works correctly. That is because after the error, the datatable is re-rendered but with slight differences which allows it to work correctly. I'm not sure why the table is being re-rendered when all that I'm doing is trying to get an instance of the existing datatable.
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Unfortunately the debugger doesn't work quite like that. I'll be able to reproduce the table from it, but it will take time, and I'm afraid it will be a few days before I've got free time to do that.

    Allan
This discussion has been closed.