I have the following:
var oTable = $('#dataTable').dataTable({
iDisplayLength: -1,
...
...
$("#dataTable tbody").on("click", "tr", gridClickHandler);
function gridClickHandler(oTable) {
$(oTable.fnSettings().aoData).each(function () {
$(this.nTr).removeClass('row_selected');
});
$(this).addClass('row_selected');
I was told that the $(this) event will be passed to the function but I need to also pass something else as I found it gives an error relating to oTable.
How can I modify my call to gridClickHandler and the gridClickHandler function so it passes a reference to oTable and also so the $(this) works.