mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Pager: filtered rows now equals total rows when ajaxProcessing returns an array. Fixes #667
This commit is contained in:
parent
0b380ad323
commit
6ece2fe6b4
@ -306,10 +306,12 @@
|
|||||||
// ensure a zero returned row count doesn't fail the logical ||
|
// ensure a zero returned row count doesn't fail the logical ||
|
||||||
rr_count = result[t ? 1 : 0];
|
rr_count = result[t ? 1 : 0];
|
||||||
p.totalRows = isNaN(rr_count) ? p.totalRows || 0 : rr_count;
|
p.totalRows = isNaN(rr_count) ? p.totalRows || 0 : rr_count;
|
||||||
|
// can't set filtered rows when returning an array
|
||||||
|
p.filteredRows = p.totalRows;
|
||||||
d = p.totalRows === 0 ? [""] : result[t ? 0 : 1] || []; // row data
|
d = p.totalRows === 0 ? [""] : result[t ? 0 : 1] || []; // row data
|
||||||
th = result[2]; // headers
|
th = result[2]; // headers
|
||||||
}
|
}
|
||||||
l = d.length;
|
l = d && d.length;
|
||||||
if (d instanceof jQuery) {
|
if (d instanceof jQuery) {
|
||||||
if (p.processAjaxOnInit) {
|
if (p.processAjaxOnInit) {
|
||||||
// append jQuery object
|
// append jQuery object
|
||||||
|
@ -508,10 +508,12 @@ tsp = ts.pager = {
|
|||||||
// ensure a zero returned row count doesn't fail the logical ||
|
// ensure a zero returned row count doesn't fail the logical ||
|
||||||
rr_count = result[t ? 1 : 0];
|
rr_count = result[t ? 1 : 0];
|
||||||
p.totalRows = isNaN(rr_count) ? p.totalRows || 0 : rr_count;
|
p.totalRows = isNaN(rr_count) ? p.totalRows || 0 : rr_count;
|
||||||
|
// can't set filtered rows when returning an array
|
||||||
|
p.filteredRows = p.totalRows;
|
||||||
d = p.totalRows === 0 ? [""] : result[t ? 0 : 1] || []; // row data
|
d = p.totalRows === 0 ? [""] : result[t ? 0 : 1] || []; // row data
|
||||||
th = result[2]; // headers
|
th = result[2]; // headers
|
||||||
}
|
}
|
||||||
l = d.length;
|
l = d && d.length;
|
||||||
if (d instanceof jQuery) {
|
if (d instanceof jQuery) {
|
||||||
if (wo.pager_processAjaxOnInit) {
|
if (wo.pager_processAjaxOnInit) {
|
||||||
// append jQuery object
|
// append jQuery object
|
||||||
|
Loading…
Reference in New Issue
Block a user