Tablesorter with DataTables; data changes to "show all" after performing a sort.

Tablesorter with DataTables; data changes to "show all" after performing a sort.

jgouletjgoulet Posts: 26Questions: 2Answers: 1
edited August 2013 in DataTables 1.9
Ok, I'm fairly certain this comes down to something that I can [hopefully] solve in the initialization code. I am using Tablesorter to sort my DataTables columns. When I click the column header to sort, it changes to show all data, regardless of what value was in the "length" prior to the sort. All the paginate buttons are still there, and if I click on "Next" or a specific page number, it will go back to the value that is in the "length". I'm hoping there is a line or two of code that I can throw in the initialization to re-initialize the "length" value (if that makes sense). Here is the current initialization code:

[code]
$(document).ready(function() {
$("#institution").tablesorter({
headers: {
6: {
sorter: false
}
}
});
$('#institution').dataTable( {
"sScrollY": "200px",
"sPaginationType": "full_numbers",
"bScrollCollapse": true,
} );
} );

[/code]

Replies

  • aaronwaaronw Posts: 89Questions: 3Answers: 4
    I'm not sure I understand why you're using tablesorter and datatables at the same time - it seems to me like it could be that both of them are trying to assert the control over the table and getting caught up with each other. What functionality are you using in tablesorter that you can't do in datatables?
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Agreed - I'm not sure how they would work together. In fact - I can't see how they would work together!

    Allan
  • jgouletjgoulet Posts: 26Questions: 2Answers: 1
    Yup, I dropped the ball on that one. For some reason I got the impression that I needed a separate sort plugin for DataTables. I got rid of Tablesorter and all is well. Sorry about that!
This discussion has been closed.