fnGetData not returning row information

fnGetData not returning row information

scullytrscullytr Posts: 12Questions: 0Answers: 0
edited February 2012 in DataTables 1.9
Hello,

I'm trying to use fnGetData to get the values of a row that was clicked on using the technique in the documentation, but for some reason fnGetData is only returning an empty array.

[code]
var tableId = '#table1';
var oTable[tableId] = $(tableId).dataTable(); // Using oTable array due to multiple tables on the page

oTable[tableId].$('tr').on('click', showRow);

function showRow(){
console.log(oTable[tableId].fnGetData(this));
}
[/code]

returns simply...
[code]
[ ]
[/code]

...in the console.

Replies

  • scullytrscullytr Posts: 12Questions: 0Answers: 0
    I checked, and 'this' in the showRow function does return the row node that was clicked on.
  • allanallan Posts: 63,493Questions: 1Answers: 10,470 Site admin
    Seems to work okay for me: http://live.datatables.net/uwewob/edit

    I've changed in invalid syntax of "var oTable[tableId]", but other than that - it looks fine.

    Allan
  • scullytrscullytr Posts: 12Questions: 0Answers: 0
    Well, I restructured how my app was put together (for other reasons), and it seems to be working now. Not sure what was going on, but I really appreciate you looking at it! :-)

    Thanks Allan.
This discussion has been closed.