mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Pager filtered rows count properly includes/excludes child rows
This commit is contained in:
parent
9a716bec07
commit
5a1c22a349
@ -120,10 +120,11 @@
|
|||||||
var i, pg, s, out,
|
var i, pg, s, out,
|
||||||
c = table.config,
|
c = table.config,
|
||||||
f = c.$table.hasClass('hasFilters') && !p.ajaxUrl,
|
f = c.$table.hasClass('hasFilters') && !p.ajaxUrl,
|
||||||
t = (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered') + ',' + c.selectorRemove,
|
t = (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered') + ',' + c.selectorRemove +
|
||||||
|
(p.countChildRows ? '' : ',.' + c.cssChildRow),
|
||||||
sz = p.size || 10; // don't allow dividing by zero
|
sz = p.size || 10; // don't allow dividing by zero
|
||||||
p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
|
p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
|
||||||
p.filteredRows = (f) ? c.$tbodies.eq(0).children('tr:not(.' + t + ')').length : p.totalRows;
|
p.filteredRows = (f) ? c.$tbodies.eq(0).children('tr').not('.' + t ).length : p.totalRows;
|
||||||
p.filteredPages = (f) ? Math.ceil( p.filteredRows / sz ) || 1 : p.totalPages;
|
p.filteredPages = (f) ? Math.ceil( p.filteredRows / sz ) || 1 : p.totalPages;
|
||||||
if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) {
|
if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) {
|
||||||
t = (p.size * p.page > p.filteredRows);
|
t = (p.size * p.page > p.filteredRows);
|
||||||
|
@ -307,12 +307,12 @@ tsp = ts.pager = {
|
|||||||
wo = c.widgetOptions,
|
wo = c.widgetOptions,
|
||||||
p = c.pager,
|
p = c.pager,
|
||||||
f = c.$table.hasClass('hasFilters') && !wo.pager_ajaxUrl,
|
f = c.$table.hasClass('hasFilters') && !wo.pager_ajaxUrl,
|
||||||
t = (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered') + ',' + c.selectorRemove,
|
t = (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered') + ',' + c.selectorRemove +
|
||||||
|
(wo.pager_countChildRows ? '' : ',.' + c.cssChildRow),
|
||||||
sz = p.size || 10; // don't allow dividing by zero
|
sz = p.size || 10; // don't allow dividing by zero
|
||||||
p.$size.removeClass(wo.pager_css.disabled).removeAttr('disabled');
|
p.$size.add(p.$goto).removeClass(wo.pager_css.disabled).removeAttr('disabled');
|
||||||
p.$goto.removeClass(wo.pager_css.disabled).removeAttr('disabled');
|
|
||||||
p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
|
p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
|
||||||
p.filteredRows = (f) ? c.$tbodies.eq(0).children('tr:not(.' + t + ')').length : p.totalRows;
|
p.filteredRows = (f) ? c.$tbodies.eq(0).children('tr').not('.' + t).length : p.totalRows;
|
||||||
p.filteredPages = (f) ? Math.ceil( p.filteredRows / sz ) || 1 : p.totalPages;
|
p.filteredPages = (f) ? Math.ceil( p.filteredRows / sz ) || 1 : p.totalPages;
|
||||||
if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) {
|
if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) {
|
||||||
t = (p.size * p.page > p.filteredRows);
|
t = (p.size * p.page > p.filteredRows);
|
||||||
|
Loading…
Reference in New Issue
Block a user