gpt4 book ai didi

javascript - 表排序器 : table. config.parsers[c] 未定义

转载 作者:行者123 更新时间:2023-11-30 18:02:33 24 4
gpt4 key购买 nike

我在使用 tablesorter plugin 时遇到问题, 好像他无法执行对表进行排序的功能,有人帮助我,我已经两天试图解决这个问题。

错误下方

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 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>

最佳答案

我知道现在回答有点晚了,但我发现,如果表为空(可能是由于 PHP 查询从数据库中产生了零行),则会触发此错误。

您可以使用一种简单的方法:如果表为空,则从表标记中删除 data-sort="table" 属性。这样,如果你的 JS 代码是这样的:

    $("[data-sort=table]").tablesorter({
sortList: [[0,0]]
});

您可以确定它会避免所有空表,只留下准备好排序的填充表。

关于javascript - 表排序器 : table. config.parsers[c] 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16589992/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com