Row click not firing off after Sort/Search/Next Page
Row click not firing off after Sort/Search/Next Page
gdawgrancid
Posts: 2Questions: 0Answers: 0
I have a table that uses sorting and a tr click listener. It works fine at first, but whenever I try to sort, search, or go to the next page, I can no longer select a row. It only highlights the text in whatever table cell I'm clicking on. Do these things just not work well together or is it something on my side that could be causing this?
Here is the code I am using for my datatable:
[code]
var oTable=$('#OrderHistory').dataTable( {
"bAutoWidth": false,
"bJQueryUI":true,
"sPaginationType":"full_numbers",
"aaData": aDataSet,
"iDisplayLength": 25,
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'25'+
'50'+
'100'+
'200'+
'All'+
' records'
},
"aoColumns": [
{ "sTitle": "Customer Name","sWidth":"30%" },
{ "sTitle": "Manufacturer","sWidth":"25%"},
{ "sTitle": "Order Date","sWidth":"15%" },
{ "sTitle": "PO","sWidth":"15%" },
{ "sTitle": "Order Code","sWidth":"15%" },
{ "sTitle": "OrderID","sWidth":"0%", "sClass":"orderID"},
]
} );
$("#OrderHistory tbody tr").click( function( e ) {
if ( $(this).hasClass('row_selected') ) {
$(this).removeClass('row_selected');
loadOrderHistory(this);
}
else {
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});[/code]
Here is my debugging link http://debug.datatables.net/usozes
Here is the code I am using for my datatable:
[code]
var oTable=$('#OrderHistory').dataTable( {
"bAutoWidth": false,
"bJQueryUI":true,
"sPaginationType":"full_numbers",
"aaData": aDataSet,
"iDisplayLength": 25,
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'25'+
'50'+
'100'+
'200'+
'All'+
' records'
},
"aoColumns": [
{ "sTitle": "Customer Name","sWidth":"30%" },
{ "sTitle": "Manufacturer","sWidth":"25%"},
{ "sTitle": "Order Date","sWidth":"15%" },
{ "sTitle": "PO","sWidth":"15%" },
{ "sTitle": "Order Code","sWidth":"15%" },
{ "sTitle": "OrderID","sWidth":"0%", "sClass":"orderID"},
]
} );
$("#OrderHistory tbody tr").click( function( e ) {
if ( $(this).hasClass('row_selected') ) {
$(this).removeClass('row_selected');
loadOrderHistory(this);
}
else {
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});[/code]
Here is my debugging link http://debug.datatables.net/usozes
This discussion has been closed.
Replies