Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 在特定列上单击一次后,Tablesorter引导程序不工作_Jquery_Twitter Bootstrap_Tablesorter - Fatal编程技术网

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']
    });
});