mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Pager: clear tbody prior to calling ajaxProcessing
This commit is contained in:
parent
00daa3d148
commit
08735db313
@ -385,6 +385,12 @@
|
||||
renderAjax = function(data, table, p, xhr, settings, exception){
|
||||
// process data
|
||||
if ( typeof p.ajaxProcessing === 'function' ) {
|
||||
|
||||
// in case nothing is returned by ajax, empty out the table; see #1032
|
||||
// but do it before calling pager_ajaxProcessing because that function may add content
|
||||
// directly to the table
|
||||
c.$tbodies.eq(0).empty();
|
||||
|
||||
// ajaxProcessing result: [ total, rows, headers ]
|
||||
var i, j, t, hsh, $f, $sh, $headers, $h, icon, th, d, l, rr_count, len,
|
||||
c = table.config,
|
||||
@ -444,9 +450,6 @@
|
||||
if (p.processAjaxOnInit) {
|
||||
c.$tbodies.eq(0).html( tds );
|
||||
}
|
||||
} else {
|
||||
// nothing returned by ajax, empty out the table; see #1032
|
||||
c.$tbodies.eq(0).empty();
|
||||
}
|
||||
p.processAjaxOnInit = true;
|
||||
// only add new header text if the length matches
|
||||
|
File diff suppressed because one or more lines are too long
2
dist/js/widgets/widget-pager.min.js
vendored
2
dist/js/widgets/widget-pager.min.js
vendored
File diff suppressed because one or more lines are too long
@ -485,9 +485,9 @@
|
||||
<br><br>
|
||||
</li>
|
||||
|
||||
<li>Pager plugin (<a href="example-pager.html">basic</a> & <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.24.0</span>).</li>
|
||||
<li>Pager plugin (<a href="example-pager.html">basic</a> & <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.24.4</span>).</li>
|
||||
<li>
|
||||
Pager widget (<a href="example-widget-pager.html">basic</a> & <a href="example-widget-pager-ajax.html">ajax</a> demos) (<span class="version">v2.12</span>; <span class="version updated">v2.24.0</span>).<br>
|
||||
Pager widget (<a href="example-widget-pager.html">basic</a> & <a href="example-widget-pager-ajax.html">ajax</a> demos) (<span class="version">v2.12</span>; <span class="version updated">v2.24.4</span>).<br>
|
||||
<br>
|
||||
</li>
|
||||
|
||||
|
@ -654,6 +654,12 @@
|
||||
wo = c.widgetOptions;
|
||||
// process data
|
||||
if ( $.isFunction(wo.pager_ajaxProcessing) ) {
|
||||
|
||||
// in case nothing is returned by ajax, empty out the table; see #1032
|
||||
// but do it before calling pager_ajaxProcessing because that function may add content
|
||||
// directly to the table
|
||||
c.$tbodies.eq(0).empty();
|
||||
|
||||
// ajaxProcessing result: [ total, rows, headers ]
|
||||
var i, j, t, hsh, $f, $sh, $headers, $h, icon, th, d, l, rr_count, len,
|
||||
$table = c.$table,
|
||||
@ -712,9 +718,6 @@
|
||||
if (wo.pager_processAjaxOnInit) {
|
||||
c.$tbodies.eq(0).html( tds );
|
||||
}
|
||||
} else {
|
||||
// nothing returned by ajax, empty out the table; see #1032
|
||||
c.$tbodies.eq(0).empty();
|
||||
}
|
||||
wo.pager_processAjaxOnInit = true;
|
||||
// only add new header text if the length matches
|
||||
|
Loading…
Reference in New Issue
Block a user