Selecting a row

Selecting a row

DiegoTcDiegoTc Posts: 10Questions: 0Answers: 0
edited July 2013 in DataTables 1.9
Hi
I will like to selec one row of my table, I got the idea of the example of the selecting example, but it doesn't work.
This is my code
[code]


var oTable;
$(document).ready(function() {
oTable = $('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "tomacorrienteslist.jsp",
"bFilter": false,
"bSort": false,
"bInfo": false,
"bPaginate": false,

"aaSorting": [[ 4, "desc" ]],
"aoColumns": [
{ "mData": "codigo" },
{ "mData": "descripcion" },
{ "mData": "xbee_id" }
]


} );

$("#example tbody tr").click( function( e ) {
if ( $(this).hasClass('row_selected') ) {
$(this).removeClass('row_selected');
}
else {
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});
} );


[/code]
What's wrong?

Replies

  • rpanesarrpanesar Posts: 6Questions: 0Answers: 0
    I found the same issue yesterday, if you want you can implement TableTools plugin and than add the following code below to allow for multi-selection.

    "oTableTools": {
    "sRowSelect": "multi",
    "sSwfPath": "/swf/copy_csv_xls_pdf.swf",
    },
This discussion has been closed.