mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Pager: a pagerComplete event now fires off immediately after initialization
This commit is contained in:
parent
9a3078c33b
commit
340b39a638
@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -4833,8 +4833,11 @@ $('table').trigger( 'search', [['', '', '', '', 'orange']] ); // find orange in
|
||||
|
||||
<tr id="pagercomplete">
|
||||
<td><a href="#" class="permalink">pagerComplete</a></td>
|
||||
<td>This event fires when the pager plugin has completed its render of the table on the currently selected page. (v2.0.7).
|
||||
<td>This event fires when the pager plugin has completed initialization (<span class="version">v2.18.1</span>), and its render of the table on the currently selected page. (v2.0.7).
|
||||
<div class="collapsible">
|
||||
<br>
|
||||
<span class="label label-info">Note</span> In <span class="version">v2.18.1</span>, the "pagerComplete" event also fires off immediately after pager initialization.<br>
|
||||
<br>
|
||||
<pre class="prettyprint lang-js">$(function(){
|
||||
|
||||
// initialize the sorter
|
||||
|
@ -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);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user