开发者

jQuery tablesorterPager displaying record information summary

开发者 https://www.devze.com 2023-03-16 17:00 出处:网络
Does anyone know how to have tablesorter pager plugin display the following infromation: Displaying 1 to 10 of 57 records

Does anyone know how to have tablesorter pager plugin display the following infromation:

Displaying 1 to 10 of 57 records

That's just an example but I cant figure out where i can get the first two numbers based on how many records i am displaying per page.. I figured out how to get the total # of records. Not sure if there's a way i can g开发者_如何学运维et the other two numbers based off of that or not.. Any help would be greatly appreciated!


I've recently added a fork of the tablesorter plugin on github with some improvements and missing documents. After seeing this request, I've also updated the pager plugin to allow you to create a custom output. To get the output you requested, use this code (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'
  });

Also, the original pager HTML markup displayed this inside an input. You can now use any element. See the demo page for a full example.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号