mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
pager: calculate correct total rows when countChildRows is true
This commit is contained in:
parent
deaee241fe
commit
cb3ee451b8
@ -529,10 +529,11 @@
|
||||
};
|
||||
|
||||
$this.appender = function(table, rows) {
|
||||
var p = table.config.pager;
|
||||
var c = table.config,
|
||||
p = c.pager;
|
||||
if ( !p.ajax ) {
|
||||
table.config.rowsCopy = rows;
|
||||
p.totalRows = rows.length;
|
||||
c.rowsCopy = rows;
|
||||
p.totalRows = p.countChildRows ? c.$tbodies.eq(0).children().length : rows.length;
|
||||
p.size = $.data(table, 'pagerLastSize') || p.size;
|
||||
p.totalPages = Math.ceil( p.totalRows / ( p.size || 10 ) );
|
||||
renderTable(table, rows, p);
|
||||
|
@ -732,14 +732,14 @@ tsp = ts.pager = {
|
||||
},
|
||||
|
||||
appender: function(table, rows) {
|
||||
var p = table.config.pager;
|
||||
var c = table.config,
|
||||
p = c.pager;
|
||||
if ( !p.ajax ) {
|
||||
table.config.rowsCopy = rows;
|
||||
p.totalRows = rows.length;
|
||||
c.rowsCopy = rows;
|
||||
p.totalRows = c.widgetOptions.pager_countChildRows ? c.$tbodies.eq(0).children().length : rows.length;
|
||||
p.size = $.data(table, 'pagerLastSize') || p.size;
|
||||
p.totalPages = Math.ceil( p.totalRows / ( p.size || 10 ) );
|
||||
tsp.moveToPage(table, p);
|
||||
// tsp.renderTable(table, rows);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user