Pierre Lic
Pierre Lic

Reputation: 11

Tablesorter filter displaying but not working

I'm stuck in this situation: I installed tablesorter, and initialized the filter widget. It is correctly displaying, and it is possible to sort the columns, but the filter won't sort anything.

Any ideas ? Thanks !

My header :

<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.js"></script>
    <script type="text/javascript" src="js/jquery.tablesorter.widgets.js"></script>
    <script type="text/javascript" src="js/jquery.tablesorter.pager.js"></script>

My javascript :

$(document).ready(function() 
    { 
        $("#tablesorter").tablesorter(); 
    } 
); 

$(function() {
  $("table").tablesorter({
    widgets: [ "filter"]
  });
});

Upvotes: 0

Views: 981

Answers (2)

Robert
Robert

Reputation: 724

Perhaps the answer given here would help. Add the following to your css file:

/* rows hidden by filtering (needed for child rows) */
.tablesorter .filtered {
    display: none;
}

Upvotes: 2

Mottie
Mottie

Reputation: 86453

Don't initialize tablesorter twice. The second time it is initialized, all options are ignored.

Change your code to this:

$(function() {
  $("table").tablesorter({
    widgets: [ "filter"]
  });
});

Upvotes: 0

Related Questions