我下载了Tablesorter并且它运行正常但是如果我在codeigniter中使用firebug说明c is undefined
从下拉列表中选择不同的值。
我将所有js资源文件包含在views / template / header /
中的header.php
<!-- Tablesorter -->
<?php echo link_tag('tablesorter/themes/blue/style.css');?>
<script type="text/javascript" src="<?php echo base_url(); ?>tablesorter/js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>tablesorter/js/jquery.tablesorter.pager.js"></script>
<script type="text/javascript">
$(function() {
$("table")
.tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
});
</script>
<!--// Tablesorter -->
和我使用tablesorter的视图是
视图/国家/ index.php的
的index.php
<table cellspacing="1" class="tablesorter">
<thead>
<tr>
<th>Country Name</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Country Name</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<?php foreach ($countries as $key): ?>
<tr>
<td><?php echo $key['countryName'];?></td>
<td><?php echo anchor("countries/edit/".$key['countryId'],"Edit")?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div id="pager" class="pager">
<form>
<img src="<?php echo base_url(); ?>tablesorter/icons/first.png" class="first"/> <img src="<?php echo base_url(); ?>tablesorter/icons/prev.png" class="prev"/>
<input type="text" class="pagedisplay"/>
<img src="<?php echo base_url(); ?>tablesorter/icons/next.png" class="next"/> <img src="<?php echo base_url(); ?>tablesorter/icons/last.png" class="last"/>
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
</form>
</div>
现在与CodeIgniter集成后,它只适用于升序/降序但分页不起作用,而firebug说c is undefined