Problem highlighting a row selection
Problem highlighting a row selection
I'm making 3 tables in an array (oTable[0] to oTable[2]). Here is an example:
[code]
oTable[2] = $('#terrestrial').dataTable( {
"aLengthMenu": [[5, 25, 50, -1], [5, 25, 50, "All"]],
"iDisplayLength": 5,
"sScrollY": "250px",
"bScrollCollapse": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "which_type", "value": "terrestrial" },
{ "name": "SWlat", "value": coords[0]},
{ "name": "SWlng", "value": coords[1]},
{ "name": "NElat", "value": coords[2]},
{ "name": "NElng", "value": coords[3]} )
},
"fnDrawCallback": function (oSettings) {plotMarkers()}
} );
$('#terrestrial').on( 'click', 'tr', function () {
var row_data = oTable[2].fnGetData( this );
var row_clicked_marker = markerArray[row_data[0]];
toggleClickedMarker(row_clicked_marker);
} );
$("#terrestrial tbody tr").click(function(event){
$("td.row_selected", oTable[2].fnGetNodes()).removeClass('row_selected');
$(event.target).parent().find("td").addClass('row_selected');
} );
[/code]
Everything works perfectly except the section at the end that is meant to highlight a selected row. When a row is clicked, the click function works as expected but the row_selection part doesn't seem to do anything. I've tried adding a row_selection entry to my stylesheet but with no success.
Appreciate any help.
I'm using the 1.9.4 css from aspnetcdn
[code]
oTable[2] = $('#terrestrial').dataTable( {
"aLengthMenu": [[5, 25, 50, -1], [5, 25, 50, "All"]],
"iDisplayLength": 5,
"sScrollY": "250px",
"bScrollCollapse": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "which_type", "value": "terrestrial" },
{ "name": "SWlat", "value": coords[0]},
{ "name": "SWlng", "value": coords[1]},
{ "name": "NElat", "value": coords[2]},
{ "name": "NElng", "value": coords[3]} )
},
"fnDrawCallback": function (oSettings) {plotMarkers()}
} );
$('#terrestrial').on( 'click', 'tr', function () {
var row_data = oTable[2].fnGetData( this );
var row_clicked_marker = markerArray[row_data[0]];
toggleClickedMarker(row_clicked_marker);
} );
$("#terrestrial tbody tr").click(function(event){
$("td.row_selected", oTable[2].fnGetNodes()).removeClass('row_selected');
$(event.target).parent().find("td").addClass('row_selected');
} );
[/code]
Everything works perfectly except the section at the end that is meant to highlight a selected row. When a row is clicked, the click function works as expected but the row_selection part doesn't seem to do anything. I've tried adding a row_selection entry to my stylesheet but with no success.
Appreciate any help.
I'm using the 1.9.4 css from aspnetcdn
This discussion has been closed.