fnGetData not returning row information
fnGetData not returning row information
scullytr
Posts: 12Questions: 0Answers: 0
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.
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.
This discussion has been closed.
Replies
I've changed in invalid syntax of "var oTable[tableId]", but other than that - it looks fine.
Allan
Thanks Allan.