Permalink
Browse files

retain pager size & total pages

  • Loading branch information...
1 parent 628e0ee commit 7b70cea5184682debd61e1553bcd26217e0168c4 @Mottie committed Oct 28, 2011
Showing with 16 additions and 5 deletions.
  1. +4 −0 README.markdown
  2. +4 −2 addons/pager/jquery.tablesorter.pager.js
  3. +2 −2 addons/pager/jquery.tablesorter.pager.min.js
  4. +6 −1 changelog.txt
View
@@ -28,6 +28,10 @@ Included all original [document pages](http://mottie.github.com/tablesorter/docs
View the [complete listing here](http://mottie.github.com/tablesorter/changelog.txt).
+#### Version 2.0.23.2 (2011-10-28)
+
+* Fixed pager size & total pages not being retained after destroying, then restoring the pager. Thanks to crush123 for reporting the problem!
+
#### Version 2.0.23.1 (2011-10-26)
* Fixed the pager plugin to prevent errors when initialized on an empty table. Fix for [issue #5](https://github.com/Mottie/tablesorter/issues/5).
@@ -1,6 +1,6 @@
/*
* tablesorter pager plugin
- * updated 10/26/2011
+ * updated 10/28/2011
*/
(function($) {
@@ -65,7 +65,7 @@
},
hideRowsSetup = function(table, c){
- c.size = parseInt($(c.cssPageSize, c.container).val(), 10);
+ c.size = c.lastSize = parseInt($(c.cssPageSize, c.container).val(), 10);
pagerArrows(c);
if (!c.removeRows) {
hideRows(table, c);
@@ -110,6 +110,7 @@
showAllRows = function(table, c){
c.lastPage = c.page;
+ c.lastSize = c.size;
c.size = c.totalRows;
c.totalPages = 1;
renderTable(table, c.rowsCopy, c);
@@ -176,6 +177,7 @@
var c = table.config;
c.rowsCopy = rows;
c.totalRows = rows.length;
+ c.size = c.lastSize || c.size;
c.totalPages = Math.ceil(c.totalRows / c.size);
renderTable(table, rows, c);
};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,7 +1,12 @@
TableSorter Change Log
+Version 2.0.23.2 (2011-10-28)
+============================
+
+* Fixed pager size & total pages not being retained after destroying, then restoring the pager. Thanks to crush123 for reporting the problem!
+
Version 2.0.23.1 (2011-10-26)
-============================]
+============================
* Fixed the pager plugin to prevent errors when initialized on an empty table. Fix for [issue #5](https://github.com/Mottie/tablesorter/issues/5).
* Added a Resizable Column widget

0 comments on commit 7b70cea

Please sign in to comment.