Better check if a table contains data before using the tablesorter

This commit is contained in:
Paolo
2017-12-01 15:15:16 +01:00
parent 34329edb74
commit ec00c93d04
+3 -3
View File
@@ -69,9 +69,9 @@ if($jqueryV1 && $jqueryCurrent)
<script language="Javascript" type="text/javascript"> <script language="Javascript" type="text/javascript">
$(document).ready(function() $(document).ready(function()
{ {
// // Checks if the table contains data (rows)
if(!$('#<?php echo $tableid; ?>').find('tbody:empty').length if ($('#<?php echo $tableid; ?>').find('tbody:empty').length > 0
&& !$('#<?php echo $tableid; ?>').find('tr:empty').length) && $('#<?php echo $tableid; ?>').find('tr:empty').length > 0)
{ {
$("#<?php echo $tableid; ?>").tablesorter( $("#<?php echo $tableid; ?>").tablesorter(
{ {