Bugfix tablesorter, if a table is empty jquery not works anymore

This commit is contained in:
Paolo
2017-11-29 18:24:54 +01:00
parent c105363fd0
commit 80b954365e
+11 -5
View File
@@ -69,12 +69,17 @@ if($jqueryV1 && $jqueryCurrent)
<script language="Javascript" type="text/javascript">
$(document).ready(function()
{
$("#<?php echo $tableid; ?>").tablesorter(
//
if(!$('#<?php echo $tableid; ?>').find('tbody:empty').length
&& !$('#<?php echo $tableid; ?>').find('tr:empty').length)
{
sortList: [[<?php echo $sortList; ?>]],
widgets: ["<?php echo $widgets; ?>"],
headers: {<?php echo $headers; ?>}
});
$("#<?php echo $tableid; ?>").tablesorter(
{
sortList: [[<?php echo $sortList; ?>]],
widgets: ["<?php echo $widgets; ?>"],
headers: {<?php echo $headers; ?>}
});
}
});
</script>
<?php endif ?>
@@ -108,4 +113,5 @@ if($jqueryV1 && $jqueryCurrent)
<?php if($widgetsCSS) : ?>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('skin/widgets.css'); ?>" />
<?php endif ?>
</head>