标签: tablesorter

预期行为:对分页表的列进行排序

当用户查看分页表并请求按特定列排序时,会显示哪个页面?

这种情况是否有标准的预期行为?我可以想象几种可能的结果,但想知道是否有一个标准。

standards user-interface tablesorter uitableview

3
推荐指数
1
解决办法
872
查看次数

jQuery tablesorter插件 - 执行AFTER表排序后的操作

我有一个表使用tablesorter插件成功排序.但是,我想突出显示特定行中特定文本字段中的文本.它有一个唯一的ID,但是当我将代码放在排序代码之后它不起作用.这是我的代码:

jQuery(document).ready(function() { 
  jQuery("#filetable").tablesorter({
    sortList: [[3,1]],
    widgets: ['zebra'],
    testExtraction: "complex"
  });
  //my new code which doesn't work as expected
  if(jQuery("#new_foldername").length > 0){ 
    jQuery("#new_foldername").focus(function() { jQuery(this).select(); } ); 
  }
}); 
Run Code Online (Sandbox Code Playgroud)

如果我在检查之后粘贴警报以查看#new_foldername是否存在,我会看到警报,并且我看到背景中突出显示的文本(因此我的代码突出显示文本有效).当我单击以关闭警报时,表格将完成排序...并且文本不再突出显示.

有什么想法可能会发生什么?

jquery tablesorter highlight

3
推荐指数
1
解决办法
3694
查看次数

Tablesorter 主题,单击按钮时更改行背景

我正在使用 tablesorter 2.0,并且我一直在尝试在单击按钮时覆盖 css 主题,但我似乎无法进行任何操作。我试图在主题文件中添加一些 css,但我认为另一个属性覆盖了它。我想要做的是更改某个类的行的背景颜色

如果有人可以查看并告诉我将类和属性添加到此文件的位置,我们将不胜感激。

这是 tablesorter 的主题文件:

table.tablesorter {
    font-family:arial;
    background-color: #CDCDCD;
    margin:10px 0pt 15px;
    font-size: 8pt;
    width: 100%;
    text-align: left;
    border-radius:3px;
}
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
    background-color: #e6EEEE;
    border: 1px solid #FFF;
    font-size: 8pt;
    padding: 4px;
}
table.tablesorter thead tr .header {
    background-image: url(bg.gif);
    background-repeat: no-repeat;
    background-position: center right;
    cursor: pointer;
}
table.tablesorter tbody td {
    color: #3D3D3D;
    padding: 4px;
    background-color: #FFF;
    vertical-align: top;
}
table.tablesorter tbody tr.odd td …
Run Code Online (Sandbox Code Playgroud)

css jquery tablesorter css-tables

3
推荐指数
1
解决办法
4134
查看次数

Tablesorter在排序后添加已删除的行

我正在使用jquery Tablesorter插件,当我删除一行然后去排序列时,删除的行再次出现.从我在这里看到的stackoverflow是我可能需要添加trigger.update和/或trigger.appendcache,但这似乎不起作用,你可能会把它放在错误的地方.有任何想法吗?

<script type="text/javascript">
$(function () {
    $(".tablesorter").tablesorter({
        headers: { 0: { sorter: false }, 1: { sorter: false }, 2: { sorter: false }, 3: { sorter: false} },
        widgets: ['zebra'],
        widgetZebra: { css: ['alt-even-class', 'alt-odd-class'] }
    });

    $('div#deleteDialog').dialog({
        autoOpen: false,
        width: 400,
        height: 200,
        modal: true,
        position: 'center',
        resizable: false,
        buttons: {
            OK: function () {
                var delID = $('div#deleteDialog input').val();
                $.post('@Url.Action("Delete", "Plate")', { id: delID }, function (data) {
                    if (data === 'delete') {
                        $('tr#' + delID).remove(); …
Run Code Online (Sandbox Code Playgroud)

tablesorter

3
推荐指数
1
解决办法
1577
查看次数

jQuery tablesorter对逗号分隔的数字进行排序

我正在使用jQuery Tablesorter 2.0(http://tablesorter.com/docs/).排序数字工作正常,但只要我添加

number_format($count);
Run Code Online (Sandbox Code Playgroud)

在我的代码中,排序不再起作用了.它的排序如下:

810,208 - > 7,671,897 - > 2,329,439

代替

7,671,897 - > 2,329,439 - > 810,208

有任何解决这个问题的方法吗?我需要逗号分隔数字以便更好地阅读.谢谢

jquery tablesorter

3
推荐指数
1
解决办法
5180
查看次数

tablesorter用逗号分隔数字

我在使用tablesorter插件时遇到问题,例如:9,789,000.00等货币.

有谁知道这方面的工作?

请不要向我推荐其他图书馆.

jquery tablesorter

3
推荐指数
1
解决办法
4667
查看次数

将jQuery tablesorter与thead结合起来:如何分配最终的html输出?

我想使用tablesorter插件:http: //tablesorter.com/docs/

使用thead插件:http: //www.asual.com/jquery/thead/

它到目前为止工作,但是thead插件在tablesorter添加排序函数之前使用源代码,因此如果我们向下滚动,则"flying thead"中缺少sort函数.

如何通过tablesorter将修改后的html源分配给thead?

我的代码:

$(document).ready(function() {
        $.tablesorter.addParser({
            id: "axis",
            is: function(s) {
                return false;
            },
            format: function(s,table,cell) {
                    return $(cell).attr("axis");
            },
            type: "numeric"
        });
        $.tablesorter.addParser({
            id: "floatval",
            is: function(s) {
                return false;
            },
            format: function(s) {
                return s.replace(/\./g,"").replace(/,/g,".").replace(/[^0-9-.]/g, "");
            },
            type: "numeric"
        });
        $.tablesorter.addParser({
            id: "germandate",
            is: function(s) {
                return false;
            },
            format: function(s) {
                var a = s.split(".");
                a[1] = a[1].replace(/^[0]+/g,"");
                return new Date(a.reverse().join("/")).getTime();
            },
            type: "numeric"
        });
        $("#ax_overview").tablesorter({
            headers: { …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery tablesorter

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

如果有类,jQuery Tablesorter不对列进行排序

我目前使用以下内容告诉我的表不使用jquery Tablesorter插件对某些列进行排序:

$(".uiGridContent table").tablesorter({
        sortList: [[1, 0]],
        headers: {
            0: { sorter: false },
            5: { sorter: false },
            6: { sorter: false }
        }
    });
Run Code Online (Sandbox Code Playgroud)

问题是在我的应用程序上,用户可以添加和删除列,因此订单可以更改,因此我当前的代码不是一个可行的解决方案.如果我在列上放一个类,我不想排序,例如<col class="nosort" />我怎么能这样做,所以它不排序那些列?

因为我正在使用<col />我尝试了以下内容:

$filter_ignore = $("col.nosort").closest("th").index();

    $(".uiGridContent table").tablesorter({
        sortList: [[1, 0]],
        headers: {
            $filter_ignore: {
                sorter: false
            }
        }
    });
Run Code Online (Sandbox Code Playgroud)

但是不起作用:/

我想我需要某种循环来找到所有这些带有柱子的柱子!这是我的表的一个例子:

<table>
 <colgroup>
  <col class="nosort" />
  <col />
 </colgroup>
  <thead>
   <tr>
    <th scope="col">a</th>
    <th scope="col">b</th>
   </tr>
  </thead>
  <tbody>
   <tr>
    <td scope="col">a</td>
    <td scope="col">b</td>
   </tr>
  </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

谢谢

jquery tablesorter

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

隐藏过滤器输入框而不是禁用+ tablesorter 2

我需要一些帮助.我正在使用JQuery TableSorter 2(http://mottie.github.com/tablesorter/)的分支来处理和过滤我的表.如果我不想将某些列用作过滤器,我只需要将"filter-false"作为类添加到所选列标题中.

我的主要问题是,是否有一种方法可以实际隐藏所选列上的过滤器框而不是仅禁用它们...

谢谢

灵光

jquery tablesorter

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

Tablesorter服务器端分页 - 不同Ajax选项的要求

我打算使用tablesorter的Ajax服务器端分页功能,但有一些关于它是如何工作的问题.2.10.0的文档说:

ajaxProcessing函数已更新为仅需要返回总行数,而不是返回表行数组,您可以自己构建表并返回包含这些行的jQuery对象

如果你自己构建表(我假设这意味着下一组行的完整HTML,包括单元格值),ajaxUrl是否仍然需要返回行集的JSON信息,还是应该返回表的HTML?如果要返回JSON信息,表格如何输入到jQuery中?

ajaxProcessing只能返回总行数和$行作为对象或数组,或者也可以返回标题:什么决定哪些是这些选项的最佳选择?如何创建$ rows对象?一般来说,如何更改代码以实现这些不同的选项?

对不起,如果我对此有点慢,感谢任何指示.

问候,

林顿


在这里继续我的问题,更多细节我对一件事感到困惑:

我的ajaxUrl会将下一组行作为HTML获取,而分页的正常语法(即没有表格分类器)是:

databasequery.php?offset=0&numrows=25
Run Code Online (Sandbox Code Playgroud)

偏移量和数量是定义为php调用的一部分的变量.我不清楚如何与它一起使用size={size}&page={page},以便与表分拣机一起正常工作.

感谢任何提示.谢谢,

jquery pagination tablesorter server-side

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