Added FixedHeader and can no longer sort columns
Added FixedHeader and can no longer sort columns
tobtob
Posts: 5Questions: 0Answers: 0
I've had datatables working fine on this page for a while.... I added FixedHeader which works fine (keeps header at top while scrolling) but column sorting is no longer working. I don't see any js errors.
Here is a working page without FixedHeader: http://www.teetimegolfpass.com/ne/golfcourses1.php?region=NE
Here is the failing page: http://www.teetimegolfpass.com/ne/golfcourses.php?region=NE
Here is the code on the page:
[code]
oTable = $('#example').dataTable( {
"iDisplayLength": 50,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[0, 'asc']]
});
new FixedHeader( oTable);
} );
[/code]
Thanks in advance for any help you can provide.
Here is a working page without FixedHeader: http://www.teetimegolfpass.com/ne/golfcourses1.php?region=NE
Here is the failing page: http://www.teetimegolfpass.com/ne/golfcourses.php?region=NE
Here is the code on the page:
[code]
oTable = $('#example').dataTable( {
"iDisplayLength": 50,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[0, 'asc']]
});
new FixedHeader( oTable);
} );
[/code]
Thanks in advance for any help you can provide.
This discussion has been closed.
Replies
If I comment out ONLY the FixedHeader line the tables orting works fine. See this page. It's a duplicate of the failing page with the FIxedHeader line commented out.
http://www.teetimegolfpass.com/ne/golfcourses2.php?region=NE
You'll need use `new $.fn.dataTable.FixedHeader( ... )` to initialise the FixedHeader as there is no longer a global variable.
Allan
I Also updated to 2.1.0
[code]
var oTable = $('#example').dataTable( {
"iDisplayLength": 50,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[0, 'asc']]
});
new $.fn.dataTable.FixedHeader( oTable)
/*new FixedHeader( oTable);*/
} );
[/code]
Allan