标签: tablesorter

tablesorter寻呼机初始分页

对于你们这些人来说这听起来像是一个非常愚蠢的问题,但我向你们保证,我一直在通过互联网查看,我对此没有任何好运.我的问题是:是否可以在tablesorter寻呼机插件中设置初始分页编号?默认情况下,它需要10个选项,但我试图将5作为选定的选项,它仍然加载10.如果我更改它并返回到5,它将按照所述5加载,但不会在开始时加载.

加载tablesorter时有什么选择吗?我对tablesorter的代码是这样的:

$("#TST").tablesorter({
        headers: { 0: { sorter: false }, 4: { sorter: false }, 5: { sorter: false }, 6: { sorter: false} },
        sortList: [[1, 0], [2, 0], [3, 0]],
        widgets: ['zebra']
    })
  .tablesorterPager({
        container: $("#TSTPager"),
        positionFixed: false //,
        //pagesize: 5 
});
Run Code Online (Sandbox Code Playgroud)

我在tablesorterPager中写的pagesize属性是一个测试,但它不能达到我想要的效果.

jquery pagination tablesorter

9
推荐指数
1
解决办法
2万
查看次数

jquery tablesorter ajax表只排序一个方向

我有一个表,我通过jQuery加载命令加载.在load函数的回调中,我启动了tablesorter插件.由于某种原因,该表仅对降序进行排序而不是升序.甚至更奇怪,如果我按住shift,它将在asc和desc之间正确切换?知道这里发生了什么吗?

table.php

<table id="xyz">
<thead>
    <tr>
        <th>hi</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>a</td>
    </tr>
    <tr>
        <td>b</td>
    </tr>
    <tr>
        <td>c</td>
    </tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

jQuery的

$("#myDiv").load("table.php", function() {
    $("#xyz").tablesorter();
});
Run Code Online (Sandbox Code Playgroud)

如果我不通过ajax加载表,那么tablesorter按预期运行.

sorting ajax jquery tablesorter

9
推荐指数
3
解决办法
5651
查看次数

JQuery TableSorter:排序箭头没有显示

我正在实现jQuery的tablesorter,但箭头似乎无法显示.

这是我到目前为止所做的:

<script type="text/javascript" src="/path/to/jquery-latest.js"></script> 
<script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script>
Run Code Online (Sandbox Code Playgroud)

$(document).ready(function() 
    { 
        $("#myTable").tablesorter(); 
    } 
); 
Run Code Online (Sandbox Code Playgroud)

该表排序很好,但箭头没有显示.我在这里错过了什么吗?
我甚至添加了以下但没有工作:

<LINK rel="StyleSheet" type="text/css" href="../tablesorter/themes/green/style.css"> 
Run Code Online (Sandbox Code Playgroud)

jquery tablesorter

9
推荐指数
2
解决办法
2万
查看次数

jQuery:强制显示修改后的dom

我遇到了一个问题,试图在我的页面上运行一个"加载微调器",该表在一个表被分类时运行,特别是对于较慢的客户端,因为对页面进行排序可能需要10秒钟.我可以看到使用微调器代码修改DOM,但是它不会显示.我希望在排序发生之前我可以做些什么来强制显示微调器,当然也可以在排序完成时停止它.

我的排序基于'sorttable.js',我已经修改它来处理表的第一列的二级排序(其中包含名称).

我的微调器使用'spin.js'.

我仍然是这个jQuery东西的新手,而且这个可排序的代码非常复杂.我突出显示了下面的部分,但我的完整修改后的可排序代码(现在)可以在'sorttable-TESTING-ONLY.js'找到, 并在'TESTING-ONLY-sort_and_spin.htm'上有一个测试html页面.

因此,脚本在页面加载时设置一些函数("......"表示跳过行):

makeSortable: function(table) {                          //line 75
  ......
  headrow = table.tHead.rows[0].cells;

  for (var i=0; i<headrow.length; i++) {                 //line 114
    .....
    headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);   //line 126

    // code to start/stop spinner
    headrow[i].sorttable_spinner = (function(val) {      //line 136
      return function(val) {
        var $this = $(this),
        data = $this.data();

        if (data.spinner) {
          data.spinner.stop();
          delete data.spinner;
        }
        if (val > 0) {
          var opts = {
            .......
           };
           data.spinner = new Spinner($.extend({color: …
Run Code Online (Sandbox Code Playgroud)

javascript jquery tablesorter spin.js

9
推荐指数
1
解决办法
2340
查看次数

具有两个标题行的tablesorter

我正在使用tablesorter jquery插件,我的表在标题中有两行.有没有办法在我的桌子上启用排序?它应该能够被第二个标题行排序,第一个标题行就是按日期对相关数据进行分组.如果使用此插件无法做到这一点,那么有人可能会建议解决方法吗?

这是我的表格标记的一个例子

<table>
  <thead>
    <tr>
      <th colspan="3">January</th>
      <th colspan="3">February</th>
      <th colspan="3">March</th>
    </tr>
    <tr>
      <!-- January -->
      <th>Metric 1</th>
      <th>Metric 2</th>
      <th>Metric 3</th>
      <!-- February -->
      <th>Metric 1</th>
      <th>Metric 2</th>
      <th>Metric 3</th>
      <!-- March -->
      <th>Metric 1</th>
      <th>Metric 2</th>
      <th>Metric 3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <!-- January -->
      <td>Value 1</td>
      <td>Value 2</td>
      <td>Value 3</td>
      <!-- February -->
      <td>Value 1</td>
      <td>Value 2</td>
      <td>Value 3</td>
      <!-- March -->
      <td>Value 1</td>
      <td>Value 2</td>
      <td>Value 3</td>
    </tr>
    <tr>...</tr>
    <tr>...</tr>
    <!-- etc --> …
Run Code Online (Sandbox Code Playgroud)

jquery tablesorter jquery-plugins

9
推荐指数
1
解决办法
6536
查看次数

如何隐藏表中的列切换按钮?

我想隐藏表格上方的表格中的列切换按钮或列选择器按钮.我正在使用jQuery Mobile ver.1.3.2.

我正在使用这个:

<table data-role="table" id="table-column-toggle" data-mode="columntoggle" class="ui-responsive table-stroke">
 <thead class="pearlHeading">
  <tr>
   <th data-priority="1">S.No.</th>
   <th >Name of the Programme</th>
   <th data-priority="2">Campus</th>
  </tr>
 </thead>
 <tbody>
 </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

我删除了

data-role="table" id="table-column-toggle" data-mode="columntoggle"
Run Code Online (Sandbox Code Playgroud)

但它不能正常工作

jquery tablesorter jquery-mobile

9
推荐指数
2
解决办法
1万
查看次数

IE7中jQuery tablesorter插件列宽不正确

我正在使用tablesorter插件(http://tablesorter.com)并且在IE7中遇到列宽问题.它在Firefox中看起来很好,有时在IE7中也很好.

这是问题的截图:

IE7查看

这是它应该看起来的样子:

Firefox视图

html javascript jquery tablesorter internet-explorer-7

8
推荐指数
1
解决办法
1960
查看次数

更新后,Jquery Tablesorter对相同的列进行排序

我有一个用ajax更新的表,并在更新之后如果排序但我需要排序不是固定列,而是在更新之前最后点击的同一列.

function tableUpdated() {
$(".tablesorter").trigger("update");
//alert($(".tablesorter").sorting);
var sorting = [[7, 0]];
$("table").trigger("sorton", [sorting]);
}
Run Code Online (Sandbox Code Playgroud)

在上面的代码中,我需要将我选择的列索引而不是7

javascript jquery tablesorter

8
推荐指数
1
解决办法
8564
查看次数

表使用表分类器使用muticolumn标头和正文值进行排序

我的表头包含两个行标题,我无法在包含colspan的列之后对列进行排序.我在jsfiddle中描述的表结构.我需要根据标题Amount和Date/time对表结构中的最后一列进行排序.但我不知道它为什么不排序.任何想法或建议可能会有所帮助.

jquery tablesorter

8
推荐指数
1
解决办法
353
查看次数

Jquery Tablesorter不工作!这有什么问题?

我是Jquery的新手,我正在尝试使用Jquery Tablesorter插件,我已经在一个简单的html文件中测试了它,如下所示,但它无法正常工作.我在浏览器中看到的只是一个没有排序的普通表,没有可点击的标题,它看起来不像我在Jquery Tablesorter主页上看到的那样.我不知道我的HTML有什么问题.我在这个html文件中将2个jquery文件放在同一个文件夹中.请指教!

<html>
<head>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="jquery.tablesorter.js"></script> 
<script type="text/javascript">
$(document).ready(function() 
    { 
         $("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} ); 
    } 
); 
</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> 
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

jquery tablesorter

8
推荐指数
1
解决办法
2万
查看次数