Note that there are some explanatory texts on larger screens.

plurals
  1. POTablesorter and search
    text
    copied!<p>I have a big table and I want to add a search function on it. I used tablesorter to do the columns sortables and also a tutorial to add another column in the beginning for numbering the rows. But Search doesn't work. Here is my code:</p> <p>HTML</p> <pre><code>&lt;script type="text/javascript" src="/static/js/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/static/js/jquery.tablesorter.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/static/js/jquery.tablesorter.pager.js"&gt;&lt;/script&gt; &lt;script src="/static/js/jquery.quicksearch.js" type="text/javascript"&gt;&lt;/script&gt; &lt;table id="myTable" class="table table-bordered tablesorter"&gt; &lt;thead&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;/tbody&gt; &lt;tfoot&gt; &lt;tr style="display:none;"&gt; &lt;td colspan="5"&gt; No rows match the filter... &lt;/td&gt; &lt;/tr&gt; &lt;/tfoot&gt; &lt;/table&gt; &lt;div id="pager" class="pager"&gt; &lt;form&gt; &lt;img src="/static/blue/first.png" class="first"/&gt; &lt;img src="/static/blue/prev.png" class="prev"/&gt; &lt;input type="text" class="pagedisplay"/&gt; &lt;img src="/static/blue/next.png" class="next"/&gt; &lt;img src="/static/blue/last.png" class="last"/&gt; &lt;select class="pagesize"&gt; &lt;option value="10"&gt;10 per page&lt;/option&gt; &lt;option value="20"&gt;20 per page&lt;/option&gt; &lt;option value="50"&gt;50 per page&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>And here is my javascript:</p> <pre><code>&lt;script&gt; $(document).ready(function() { $.tablesorter.addWidget({ id: "numbering", format: function(table) { var c = table.config; $("tr:visible", table.tBodies[0]).each(function(i) { $(this).find('td').eq(0).text(i + 1); }); } }); $("table").tablesorter({widgets: ['numbering'],sortInitialOrder: 'desc', sortList: [[2,1]],headers: {0: {sorter: false}}}) .tablesorterPager({container: $("#pager")}); $("#myTable tbody tr").quicksearch({ labelText: 'Search: ', attached: '#myTable', position: 'before', delay: 100, loaderText: 'Loading...', onAfter: function() { if ($("#myTable tbody tr:visible").length != 0) { $("#myTable").trigger("update"); $("#myTable").trigger("appendCache"); $("#myTable tfoot tr").hide(); } else { $("#myTable tfoot tr").show(); } } }); } &lt;/script&gt; </code></pre> <p>I don't see any error. Just the search function doesn't there.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload