我正在尝试使用tablesorter(tablesorter.com)的寻呼机插件,并且已经按照我在网上找到的几个例子,但我似乎无法让它工作。当我实现分页不工作,它也打破了表上的排序,它将返回错误“未捕获的TypeError:无法读取属性'msie'未定义”
这是我目前的代码
HTML / PHP
<table border="0" cellpadding="0" cellspacing="0" id="orgTable" class="tablesorter">
<thead>
<tr>
<th><?=$languageDB->berkGet("object_organization_name");?></th>
<th><?=$languageDB->berkGet("object_organization_description");?></th>
<th><?=$languageDB->berkGet("object_organization_system_name");?></th>
<th><?=$languageDB->berkGet("object_organization_status");?></th>
<th><?=$languageDB->berkGet("object_organization_client");?></th>
<th><?=$languageDB->berkGet("object_organization_actions");?></th>
</tr>
</thead>
<tbody>
<?foreach ($organizations as $organizationObj) {
foreach ($organizationObj as $curOrg) {
if($curOrg->get("name") == "System"){
//Hide the System organization from vCloud
continue;
}?>
<tr>
<td><?=$curOrg->get("name");?></td>
<td><?=$curOrg->get("description")===""?"None":$curOrg->get("description")?></td>
<td><?=$curOrg->get("systemName")?></td>
<td><?=$status[$curOrg->get('status')];?></td>
<td id="client<?=$curOrg->get('id');?>">
<?if($curOrg->get("clientId")==0){ ?>
<button class="btn btn-tiny btn-reverse associate" data-uid="<?=$curOrg->get('id');?>"><?=$languageDB->berkGet("action_associate");?></button>
<?} else{
$client=new client($curOrg->get("clientId"));?>
<?=$client->get("companyName");?>
<?}?>
</td>
<td><a href="/organizationDetails.php?id=<?=$curOrg->get('id');?>" class="btn btn-tiny"><i class="fa fa-info-circle"></i></a>
<?if($curOrg->get("clientId")>0){ ?>
<button class="btn btn-danger btn-tiny" id="remove" data-uid="<?=$curOrg->get('id');?>" data-name="<?=$curOrg->get('name');?>"><i class="fa fa-trash"></i> </button>
<?}?></td>
</tr>
<?}
}?>
</tbody>
</table>
<div id="pager" class="pager">
<form>
<img src="images/paging-first.png" class="first"/>
<img src="images/paging-prev.png" class="prev"/>
<input type="text" class="pagedisplay"/>
<img src="images/paging-next.png" class="next"/>
<img src="images/paging-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>
JAVASCRIPT
$(document).ready(function()
{
$("#orgTable").tablesorter();
$("#orgTable").tablesorterPager({container: $("#pager")});
}
);
感谢您提供任何帮助。
答案 0 :(得分:1)
tablesorter.com的寻呼机需要一个早于v1.9的jQuery版本,因为它使用$.browser()
。
所以你有两个选择:
注意:分叉的寻呼机与原始的tableorter不兼容。