diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 06dcf33a..c0451359 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -479,7 +479,8 @@ p.initialized = true; $(table) .trigger('applyWidgets') - .trigger('pagerInitialized', p); + .trigger('pagerInitialized', p) + .trigger('pagerComplete', p); } }, @@ -946,7 +947,6 @@ $t.trigger('pagerBeforeInitialized', p); enablePager(table, p, false); - if ( typeof(p.ajaxUrl) === 'string' ) { // ajax pager; interact with database p.ajax = true; @@ -964,8 +964,11 @@ // pager initialized if (!p.ajax) { p.initialized = true; + moveToPage(table, p); updatePageDisplay(table, p, true); - $(table).trigger('pagerInitialized', p); + $(table) + .trigger('pagerInitialized', p) + .trigger('pagerComplete', p); } }); }; diff --git a/docs/index.html b/docs/index.html index c679dca3..2cbc0ca0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4833,8 +4833,11 @@ $('table').trigger( 'search', [['', '', '', '', 'orange']] ); // find orange in - This event fires when the pager plugin has completed its render of the table on the currently selected page. (v2.0.7). + This event fires when the pager plugin has completed initialization (v2.18.1), and its render of the table on the currently selected page. (v2.0.7).
+
+ Note In v2.18.1, the "pagerComplete" event also fires off immediately after pager initialization.
+
$(function(){
 
   // initialize the sorter
diff --git a/js/widgets/widget-pager.js b/js/widgets/widget-pager.js
index 152de8d7..6c9bc4a9 100644
--- a/js/widgets/widget-pager.js
+++ b/js/widgets/widget-pager.js
@@ -210,7 +210,9 @@ tsp = ts.pager = {
 		// pager initialized
 		p.initialized = true;
 		p.isInitializing = false;
-		c.$table.trigger('pagerInitialized', c);
+		c.$table
+			.trigger('pagerInitialized', c)
+			.trigger('pagerComplete', c);
 		tsp.updatePageDisplay(table, c);
 	},