I’m having trouble using the tablesorter plugin, it seems he is not able to perform the function that sorts the table, someone help me, I’m two days trying to solve this problem.
Below the error
table.config.parsers[c] is undefined
Javascript:
<?php
wp_register_script( 'jquery.tablesorter.js', get_bloginfo('template_url').'/js/jquery.tablesorter.js' );
wp_enqueue_script( 'jquery.tablesorter.js' );
?>
Table Code:
<table class="widefat tablesorter">
<thead>
<th width "70%">
<u>Login do usuário:</u> guilherme | <u>Nome do usuário:</u> <span style="font-size:10;"> (<a href="admin.php?page=manage-files-main&deletefolder=/home/httpd/vhosts/simmmers.com.br/httpdocs/wp-content/uploads/file_uploads/62"> Deletar pasta</a>) </span>
</th>
<th></th>
<th>Date</th>
<th width="20%">Category</th>
<th width ="10%"></th>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" name="change_cat1" value="addit" />
<input type="hidden" name="file1" value="Indice de Confiança do Empresário Março-SC 2013.pdf.pdf" >
<input type="hidden" name="changecat_user1" value="62">
<img src="http://www.simmmers.com.br/wp-content/plugins/user-files/img/pdf.jpg" width="20" > Indice de Confiança do Empresário Março-SC 2013.pdf
</td>
<td>
<textarea name="notes1" rows=3 cols=30></textarea>
</td>
<td>25/03/2013</td>
<td>Indicadores</td>
<td align="right">
<form method="post" action="/wp-admin/admin.php?page=manage-files-main">
<a href="http://www.simmmers.com.br/wp-content/uploads/file_uploads/62/Indice de Confiança do Empresário Março-SC 2013.pdf.pdf" title="Download Indice de Confiança do Empresário Março-SC 2013.pdf.pdf">
<img src="http://www.simmmers.com.br/wp-content/plugins/user-files/img/download.png" alt="" width="20" height="20" /></a> |<input type="image" name="deletefile" value="62/Indice de Confiança do Empresário Março-SC 2013.pdf.pdf" title="Delete Indice de Confiança do Empresário Março-SC 2013.pdf.pdf" src="http://www.simmmers.com.br/wp-content/plugins/user-files/img/delete.png " alt="" width="20" height="20" /></form>
</td>
</tr>
</tbody>
</table>
I know it’s a little late for an answer, but I’ve found that, if the table is empty (likely due to a PHP query that yielded zero rows from db) this error is triggered.
You can use a simple approach: if the table is empty, remove the
data-sort="table"
attribute from the table tag. That way, if your JS code is like this:you can be sure it will avoid all the empty tables, leaving you with just the populated ones ready to be sorted.
In my case I had some rows that had colspans in them (kind of like subheader rows) and tablesorter would throw exceptions on those.