From e3a4f374af0a6c6ffb6b7b54573e7ac560195fb1 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 20 Dec 2013 08:45:34 -0600 Subject: [PATCH] Pager: correcting page calculation. Fixes #468 --- addons/pager/jquery.tablesorter.pager.js | 2 +- js/widgets/widget-pager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 06378fa4..9cea007d 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -562,7 +562,7 @@ p.page = $.data(table, 'pagerLastPage') || p.page || 0; p.size = $.data(table, 'pagerLastSize') || parseInt(pg.find('option[selected]').val(), 10) || p.size || 10; pg.val(p.size); // set page size - p.totalPages = Math.ceil( Math.min( p.totalPages, p.filteredPages ) / p.size ); + p.totalPages = Math.ceil( Math.min( p.totalRows, p.filteredRows ) / p.size ); if ( triggered ) { $(table).trigger('updateRow'); setPageSize(table, p.size, p); diff --git a/js/widgets/widget-pager.js b/js/widgets/widget-pager.js index 4a4103a9..2122922f 100644 --- a/js/widgets/widget-pager.js +++ b/js/widgets/widget-pager.js @@ -759,7 +759,7 @@ tsp = ts.pager = { p.page = $.data(table, 'pagerLastPage') || p.page || 0; p.size = $.data(table, 'pagerLastSize') || parseInt(p.$size.find('option[selected]').val(), 10) || p.size || 10; p.$size.val(p.size); // set page size - p.totalPages = Math.ceil( Math.min( p.totalPages, p.filteredPages ) / p.size ); + p.totalPages = Math.ceil( Math.min( p.totalRows, p.filteredRows ) / p.size ); c.$table.removeClass('pagerDisabled'); if ( triggered ) { c.$table.trigger('updateRow');