mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
pager: compare totalRows vs totalPages when preventing an ajax call
This commit is contained in:
parent
0107e93c94
commit
e30d8049ae
@ -495,8 +495,8 @@
|
|||||||
// making the next if comparison think the filters are different (joined by commas). Fixes #202.
|
// making the next if comparison think the filters are different (joined by commas). Fixes #202.
|
||||||
l.currentFilters = (l.currentFilters || []).join('') === '' ? [] : l.currentFilters;
|
l.currentFilters = (l.currentFilters || []).join('') === '' ? [] : l.currentFilters;
|
||||||
p.currentFilters = (p.currentFilters || []).join('') === '' ? [] : p.currentFilters;
|
p.currentFilters = (p.currentFilters || []).join('') === '' ? [] : p.currentFilters;
|
||||||
// don't allow rendering multiple times on the same page/size/totalpages/filters/sorts
|
// don't allow rendering multiple times on the same page/size/totalRows/filters/sorts
|
||||||
if ( l.page === p.page && l.size === p.size && l.totalPages === p.totalPages &&
|
if ( l.page === p.page && l.size === p.size && l.totalRows === p.totalRows &&
|
||||||
(l.currentFilters || []).join(',') === (p.currentFilters || []).join(',') &&
|
(l.currentFilters || []).join(',') === (p.currentFilters || []).join(',') &&
|
||||||
l.sortList === (c.sortList || []).join(',') ) { return; }
|
l.sortList === (c.sortList || []).join(',') ) { return; }
|
||||||
if (c.debug) {
|
if (c.debug) {
|
||||||
@ -507,7 +507,7 @@
|
|||||||
size : p.size,
|
size : p.size,
|
||||||
// fixes #408; modify sortList otherwise it auto-updates
|
// fixes #408; modify sortList otherwise it auto-updates
|
||||||
sortList : (c.sortList || []).join(','),
|
sortList : (c.sortList || []).join(','),
|
||||||
totalPages : p.totalPages,
|
totalRows : p.totalRows,
|
||||||
currentFilters : p.currentFilters || []
|
currentFilters : p.currentFilters || []
|
||||||
};
|
};
|
||||||
if (p.ajax) {
|
if (p.ajax) {
|
||||||
|
@ -691,8 +691,8 @@ tsp = ts.pager = {
|
|||||||
// making the next if comparison think the filters as different. Fixes #202.
|
// making the next if comparison think the filters as different. Fixes #202.
|
||||||
l.currentFilters = (l.currentFilters || []).join('') === '' ? [] : l.currentFilters;
|
l.currentFilters = (l.currentFilters || []).join('') === '' ? [] : l.currentFilters;
|
||||||
p.currentFilters = (p.currentFilters || []).join('') === '' ? [] : p.currentFilters;
|
p.currentFilters = (p.currentFilters || []).join('') === '' ? [] : p.currentFilters;
|
||||||
// don't allow rendering multiple times on the same page/size/totalpages/filters/sorts
|
// don't allow rendering multiple times on the same page/size/totalRows/filters/sorts
|
||||||
if ( l.page === p.page && l.size === p.size && l.totalPages === p.totalPages &&
|
if ( l.page === p.page && l.size === p.size && l.totalRows === p.totalRows &&
|
||||||
(l.currentFilters || []).join(',') === (p.currentFilters || []).join(',') &&
|
(l.currentFilters || []).join(',') === (p.currentFilters || []).join(',') &&
|
||||||
l.sortList === (c.sortList || []).join(',') ) {
|
l.sortList === (c.sortList || []).join(',') ) {
|
||||||
return;
|
return;
|
||||||
@ -705,7 +705,7 @@ tsp = ts.pager = {
|
|||||||
size : p.size,
|
size : p.size,
|
||||||
// fixes #408; modify sortList otherwise it auto-updates
|
// fixes #408; modify sortList otherwise it auto-updates
|
||||||
sortList : (c.sortList || []).join(','),
|
sortList : (c.sortList || []).join(','),
|
||||||
totalPages : p.totalPages,
|
totalRows : p.totalRows,
|
||||||
currentFilters : p.currentFilters || []
|
currentFilters : p.currentFilters || []
|
||||||
};
|
};
|
||||||
if (p.ajax) {
|
if (p.ajax) {
|
||||||
|
Loading…
Reference in New Issue
Block a user