Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82019

Cannot get Select Row example to work

$
0
0
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:
$(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/"
            });

        } );

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?

Viewing all articles
Browse latest Browse all 82019

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>