Jquery 在特定列上单击一次后,Tablesorter引导程序不工作
如果我实现这个Jquery 在特定列上单击一次后,Tablesorter引导程序不工作,jquery,twitter-bootstrap,tablesorter,Jquery,Twitter Bootstrap,Tablesorter,如果我实现这个tablesorter函数,我就有一个网页。单击列表排序器图标后,它将进行一次排序。但是,如果我将返回单击相同的列表分类器图标,它将不工作。我必须单击另一列才能进行排序。有人能帮我吗 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4
tablesorter
函数,我就有一个网页。单击列表排序器图标后,它将进行一次排序。但是,如果我将返回单击相同的列表分类器图标,它将不工作。我必须单击另一列才能进行排序。有人能帮我吗
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- choose a theme file -->
<link rel="stylesheet" href="css/theme.default.css">
<!-- load jQuery and tablesorter scripts -->
<script type="text/javascript" src="js/jquery-latest.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.js"></script>
<!-- tablesorter widgets (optional) -->
<script type="text/javascript" src="js/jquery.tablesorter.widgets.js"></script>
</head>
<body>
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
<th>Due</th>
<th>Web Site</th>
</tr>
</thead>
<tbody>
<tr>
<td>Smith</td>
<td>John</td>
<td>jsmith@gmail.com</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>fbach@yahoo.com</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>jdoe@hotmail.com</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>tconway@earthlink.net</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</tbody>
</table>
<script>
$(function(){
$("#myTable").tablesorter({ sortList: [[0,0], [1,0]] });
});
</script>
</body>
</html>
姓
名字
电子邮件
应得的
网站
史密斯
约翰
jsmith@gmail.com
$50.00
http://www.jsmith.com
巴赫
直率的
fbach@yahoo.com
$50.00
http://www.frank.com
雌鹿
杰森
jdoe@hotmail.com
$100.00
http://www.jdoe.com
康威
提姆
tconway@earthlink.net
$50.00
http://www.timconway.com
$(函数(){
$(“#myTable”).tablesorter({sortList:[[0,0],[1,0]});
});
要添加引导主题:
- 加载bootstrap.css(bootstrap本身)
- 加载
(表排序器主题)主题.bootstrap.css
- 包括
,或jquery.tablesorter.widgets.js
widget-uitheme.js
- 在
设置中包括headerTemplate
定义{icon}
- 初始化
小部件uithene
“zebra”小部件仅在您计划使用过滤器小部件时才需要包含-请阅读中的说明以了解原因。要添加引导主题:
- 加载bootstrap.css(bootstrap本身)
- 加载
(表排序器主题)主题.bootstrap.css
- 包括
,或jquery.tablesorter.widgets.js
widget-uitheme.js
- 在
设置中包括headerTemplate
定义{icon}
- 初始化
小部件uithene
“zebra”小部件仅在您计划使用过滤器小部件时才需要包含-请阅读中的说明以了解原因。您能详细说明您的问题吗?如果您为此创建一个JSFIDLE,这将非常有用。您能详细说明您的问题吗?如果您为相同的对象创建一个JSFIDLE,这将非常有用。
$(function () {
$('table').tablesorter({
theme: 'bootstrap',
headerTemplate: '{content}{icon}',
widgets: ['uitheme']
});
});