Cannot get Select Row example to work

Cannot get Select Row example to work

PhilGPhilG Posts: 8Questions: 0Answers: 0
edited November 2012 in General
I'm attempting to replicate the "Select row example" (see http://datatables.net/release-datatables/examples/api/select_row.html) in my own program. The code I'm using the initialize my table is as follows:
[code]$(document).ready(function() {
var table_obj = $("#my_table");
$('#my_table tr').click( function() {
$(this).toggleClass('row_selected');
} );

table_obj.dataTable({
"oLanguage": {
"sSearch": "Refine results:"
},
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : "/transactions_ajax/"
});

} );[/code]

My code doesn't work as expected. Clicking on a row doesn't toggle the select like it does in the example.

The only difference I can see between my code and the example is that I'm using server side processing while the example uses an inline HTML table. But I don't think that is the source of my problem?

Replies

  • PhilGPhilG Posts: 8Questions: 0Answers: 0
    It turns out I was working off the wrong example. The correct example for server side processing is http://datatables.net/release-datatables/examples/server_side/select_rows.html
This discussion has been closed.