Using fnGetNodes & fnGetData together

Using fnGetNodes & fnGetData together

boidyboidy Posts: 15Questions: 3Answers: 1
edited October 2013 in DataTables 1.9
I have been reading through the examples for fnGetNodes and fnGetData and have been able to use them both independently, but I have struggled to get them to work together in the same javascript function. My knowledge of Javascript is admittedly quite limited, so if someone could point out how to combine the 2 functions below into a single function, that would be great.

Function 1: based on the example on this website for highlighting clicked rows in a table.
[code]
$('#enterprise_table tbody').click( function(event) {
// Manage the row highlights
$(entTable.fnSettings().aoData).each(function (){
$(this.nTr).children().removeClass('row_selected');
});
$(event.target.parentNode).children().addClass('row_selected');
});
[/code]

Function 2: When a row is clicked, trigger an ajax load into another div on the page.
[code]
entTable.$('tr').click( function() {

var enterprise_arr = entTable.fnGetData( this );
var enterprise = enterprise_arr[0];


$( '#tabs' ).tabs({
beforeLoad: function( event, ui ) {
ui.ajaxSettings.url += "&enterprise=" + enterprise ;
$(ui.panel).html('');

}
});
$( '#tabs' ).tabs('refresh');
var selected_tab = $('#tabs').tabs('option', 'active');
$( '#tabs' ).tabs("load", selected_tab);
});
[/code]

Defined separately like this, I get the functionality I want in that the clicked row is highlighted on the table, and the correct data, referenced by a value in the clicked row, is loaded into the target DIV. There must be a way to combine the 2 events (row highlight and ajax load), into a single click handler, but I can't seem to get it right.
This discussion has been closed.