Hi all, I might be seriously missing something here but the following code is almost exactly the same as the example code at http://datatables.net/release-datatables/examples/api/select_single_row.html but I'm getting oSettings is null at jquery.dataTables.js line 4979.
The code breaks when I try to do
I'm pretty sure sure I'm using the latest version of everything?
Here follows my full code, its very basic.
Thanks
The code breaks when I try to do
oTable.$('tr.row_selected').removeClass('row_selected');
I'm pretty sure sure I'm using the latest version of everything?
Here follows my full code, its very basic.
var oTable; $(document).ready(function(){ $('#demo').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>'); $('#example').dataTable( { "bPaginate": true, "bLengthChange": false, "bFilter": false, "bSort": false, "bInfo": false, "bAutoWidth": false, "bServerSide": false, "aaData": [ /* Reduced data set */ [ "eng","English" , "This is a message" ], [ "afr","Afrikaans" , "Hierdie is 'n boodskap" ], ], "aoColumns": [ { "sTitle": "Language code" }, { "sTitle": "Language" }, { "sTitle": "Display string" }, ] } ); /* Add a click handler to the rows - this could be used as a callback */ $("#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'); } }); oTable = $('example').dataTable(); }); /* Get the rows which are currently selected */ function fnGetSelected( oTableLocal ) { return oTableLocal.$('tr.row_selected'); }
Thanks