From 17a8b2dd63b43bd26cabde48527cb3758546eb56 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 18 Mar 2018 08:16:57 -0500 Subject: [PATCH] Core & pager: Change pager `removeRows` check. Closes #1525 & #1466 --- js/jquery.tablesorter.js | 3 +-- js/widgets/widget-pager.js | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index ea228d21..26852646 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1473,7 +1473,6 @@ appendCache : function( c, init ) { var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime, table = c.table, - wo = c.widgetOptions, $tbodies = c.$tbodies, rows = [], cache = c.cache; @@ -1496,7 +1495,7 @@ for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) { rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row; // removeRows used by the pager plugin; don't render if using ajax - fixes #411 - if ( !c.appender || ( c.pager && ( !c.pager.removeRows || !wo.pager_removeRows ) && !c.pager.ajax ) ) { + if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) { $curTbody.append( parsed[ rowIndex ][ c.columns ].$row ); } } diff --git a/js/widgets/widget-pager.js b/js/widgets/widget-pager.js index a360aaa3..e137f990 100644 --- a/js/widgets/widget-pager.js +++ b/js/widgets/widget-pager.js @@ -158,6 +158,9 @@ setPage: wo.pager_startPage }, c.pager ); + // Used by core appendCache; !undefined is always true + p.removeRows = wo.pager_removeRows; + // pager initializes multiple times before table has completed initialization if ( p.isInitializing ) { return; }