Selectable rows not returning data?

Selectable rows not returning data?

efactorefactor Posts: 3Questions: 0Answers: 0
edited March 2010 in General
Hi,

I am having trouble getting the selectable rows to output the data of those selected rows.
Currently it is only returning the first rows data regardless of what was selected.
I was using your example example: http://datatables.net/examples/server_side/select_rows.html
Below is the code:

[code]
$(document).ready(function() {
var oTable;
var selected = [];

$('#form').submit( function() {
alert(selected);
return false;
} );
oTable = $('#report_list').dataTable({
"sDom": '<"H"lTfr>t<"F"ip>',
"bJQueryUI": true,
"bStateSave": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"iDisplayLength": 25,
"sAjaxSource": iotower_base_url+'/siteman/report/ajaxreport',
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
if ( jQuery.inArray(aData[0], selected) != -1 )
{
$(nRow).addClass('row_selected');
}
return nRow;
},
"aoColumns": [
{ "bVisible": 0 }, /* ID column */
null,
null,
null,
null
]
});
$('#report_list tbody tr').live('click', function () {
var aData = oTable.fnGetData(this);
var iId = aData[0];

if ( jQuery.inArray(iId, selected) == -1 )
{
selected[selected.length++] = iId;
}
else
{
selected = jQuery.grep(selected, function(value) {
return value != iId;
} );
}

$(this).toggleClass('row_selected');
} );
});
[/code]

Any help would be greatly appreciated.
This discussion has been closed.