【问题标题】:jQuery tablesorterPager displaying record information summaryjQuery tablesorterPager 显示记录信息摘要
【发布时间】:2011-07-27 14:37:36
【问题描述】:

有谁知道如何让tablesorter pager插件显示以下信息:

显示 57 条记录中的 1 到 10 条

这只是一个示例,但根据我每页显示的记录数,我无法弄清楚在哪里可以获得前两个数字。我想出了如何获得总记录数。不确定是否有一种方法可以让我得到其他两个数字。任何帮助将不胜感激!

【问题讨论】:

    标签: jquery tablesorter jquery-pagination


    【解决方案1】:

    我最近在 github 上添加了 tablesorter 插件的一个分支,其中包含一些改进和缺失的文档。看到此请求后,我还更新了寻呼机插件以允许您创建自定义输出。要获得您请求的输出,请使用此代码 (demo):

    $("table")
      // initialize tablesorter
      .tablesorter()
    
      // initialize the pager plugin
      .tablesorterPager({
        // target the pager markup
        container: $("#pager"),
        // output default: '{page}/{totalPages}'
        output: 'Displaying {startRow} to {endRow} of {totalRows} records'
      });
    

    此外,原始寻呼机 HTML 标记在输入中显示了此内容。您现在可以使用任何元素。有关完整示例,请参阅演示页面。

    【讨论】:

    • 太棒了!感谢更新!我一定会去看看
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多