The example in the documentation to get TR data when clicked works perfectly using DOM data source, but fails to get row data when using Ajax data source. Should oTable.$('tr').click function be inside fnInitComplete function, and if so, how to make it work?
The example says:
// Row data
$(document).ready(function() {
oTable = $('#example').dataTable();
oTable.$('tr').click( function () {
var data = oTable.fnGetData( this );
// ... do something with the array / object of data for the row
} );
} );
The example says:
// Row data
$(document).ready(function() {
oTable = $('#example').dataTable();
oTable.$('tr').click( function () {
var data = oTable.fnGetData( this );
// ... do something with the array / object of data for the row
} );
} );