pager: calculate correct total rows when countChildRows is true

This commit is contained in:
Mottie 2013-11-01 13:43:18 -05:00
parent deaee241fe
commit cb3ee451b8
2 changed files with 8 additions and 7 deletions

View File

@ -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);

View File

@ -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);
}
}