Click event works first time, but throws errors after that

Click event works first time, but throws errors after that

jwa107jwa107 Posts: 1Questions: 0Answers: 0
edited February 2013 in General
Here is my code:
[code]
$(function () {
oTable = $('#dataTable').dataTable();
oTable.on("dblclick", "tr", function() {
console.log("Click");
var data = oTable.fnGetData(this);
console.log(data);
var surveyCode = $(this).html();
var surveyId = data[colindex("Id")];
...
[/code]

The first time I click a row, it says "Click" and then prints out the data.
The second time (and any time after that) it throws an error.

Here is the error:
[quote]Uncaught TypeError: Cannot read property 'aoData' of null [/quote]

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Looks fine from that code, but I guess there is something else going on. Please link to a test case: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    Allan
This discussion has been closed.